python and macro excel

Harald Massa cpl.19.ghum at spamgourmet.com
Fri Apr 18 12:26:41 CEST 2003


Hello Georges,

> i want to integrate a macro in excel with python and execute it 
you allways have to get the win32all extenstion


What exactly do you want to do?

a) write a vba makro and execute it from Python?
o = win32com.client.Dispatch("Excel.Application")
o.Visible = 1
o.Workbooks.Add() # Double Check the actual code, changes sometimes

o.Run("NameOfYourMakro)

b) write a Python Program and execute it from VBA?
recommendation: build a COM-Server in Python, use it from VBA. More 
difficult. 

Harald




More information about the Python-list mailing list