views:

1635

answers:

4

I am using excel 2003 and the build in IDE for programming VBA, but a lot of things bug me. Obviously, the build in nature of the VBA IDE is a big pro. Is there a (free?) alternative out there?

+4  A: 

Do you need to code in VBA? You can code in C#. Here's a post from Joel's Software Discuss board.

However the C# I write is not embedded in Excel. It write it as a class library in Visual Studio .NET.

If you want embedded C# I suggested you buy Visual Studio Tools for Office. This makes life a bit easier for you as you don't have to learn how to write C# as a COM Interop component.

Maybe you should check out Office Development with Visual Studio.

Bernie Perez
+4  A: 

+1 Bernie for .NET + VSTO.

However writing code against the Excel object model in C# gets really old really fast, because in C# named arguments are not supported, and some Excel methods take a crazy argument list of 20-30 parameters, so the code looks like

object.method(, , , , , , , , something, , , , , , , , somethingElse, , , , )

I think when it comes to Excel .NET development VB.NET is the way to go, especially if you're not that familiar with the object model, you can record VBA in Excel and easily convert it to VB.NET, instead of poring through the lackluster documentation.

@OP, There isn't much in the way of VBE replacement. For more powerful text editing you can of course use your favorite text editor, but then you lose Intellisense and live syntax checking, so it's a big trade-off.

fencliff
+2  A: 

Excel's VBA IDE leaves a lot to be desired, for sure, but you should say what bugs you. There are few utilities out there that help. Google Smart Indenter and MZ-Tools to name two.

Dick Kusleika
Thanks for the tip, I will look into these tools.
sdfx
+3  A: 

Where I work we tried VSTO but it forces you to distribute assemblies, and your users will no longer be able to edit your macro's. Then it has this misguided focus on security making everything hard. To top it all off, we were not able to target multiple office versions.

I'd stick to VBA, at least if you wanna get stuff done this year. Yeah, I know it's january :)

Andomar
I agree completely. Also VBA code is faster to run than VSTO developed add ins. Of course you could get better speed with C and .XLLs.
Mark Nold