Python as VBA replacement under Windows?

Thomas Bartkus thomasbartkus at comcast.net
Wed Aug 17 10:36:10 EDT 2005


"Wolfgang Keller" <wolfgang.keller.nospam at gmx.de> wrote in message
news:mn.8a917d5881245f77.30301 at gmx.de...
> Hello,
>
> this is a potentially veeery dumb question, but:
>
> - If an application supports VBA as a macro language,
> - and if you can execute Python code from within a VBA script (how?)
> - and if the application exposes its VBA scripting interface through
> COM
>
> then it should be perfectly possible to entirely replace VBA in nearly
> all Windows applications with Python, right?
>
> TIA,
>
> sincerely,
>
> Wolfgang Keller

    "perfectly possible"?  Hmmmhh!

Because the MS Office suite and a few (very few!) other applications expose
their object models via COM, you can manipulate these programs with Python
and other languages.  No applicatoin "supports VBA as a macro language".
Rather - VBA is bundled and integrated with MS Office in order to manipulate
COM.  You can use Python to do that too!

   However

It is difficult to argue with the built in integrated editor/debugger behind
Excel, Word, PowerPoint, et al with the scripts packaged seamlessly inside
the application files.  It's also difficult to argue with the myriad of
built in VBA functions that are custom designed to ease the pain of working
with Windows internals.

   On the other hand

I can think of nothing that you can do with VBA but can not do with Python.
It just takes a bit more effort and you need to know more of Windows
internals in order to pull it off.

    "perfectly possible"?

I'm still thinking :-)
-Tom





More information about the Python-list mailing list