Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Are you able to use other languages instead of VB for Excel macros?

share|improve this question
up vote 2 down vote accepted

Yes it is possible to write excel macros in Python:

On a side note, you can even edit the existing macros in Python:

share|improve this answer
Very interesting. Do you know, how does the speed of invocation of Excel methods (i.e. round trip Python -> COM -> Excel -> COM -> Python) compares with the of VBA (in %)? I suspect it can be much slower, especially with arrays of Variant types. – Adam Ryczkowski Oct 7 '12 at 16:41

Another option is C# using .NET. Check out this link:

I've not used it much, but it might be worth a try.

share|improve this answer

It is important to note, that since exactly all Excel automation capabilities available to VBA are in fact served through the COM interface, you can use any language, which supports Windows COM (ActiveX) objects. It roughly translates to almost every modern programming language on the Planet. I personally successfully used Excel from Wolfram Research Mathematica and pure C++. If you don't have specialized library for handling Excel object hierarchy (like the one that I presume exists for Python), it may not be that nice to use as with native VB.

Visual Basic 6 (and Visual Basic for Applications) were designed with compliance with COM architecture in mind. It means, that most data types defined for COM are native for Excel and they don't need to be transformed upon each call. So I'll suspect, that handling Excel from within VBA is the most efficient.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .