Python/Excel VBComponents crash

Mark Carter cartermark46 at ukmail.com
Thu Aug 7 07:41:26 EDT 2003


I use Office 2000, and I have recently upgraded to python 2.3 and
win32all-155.exe

The following code worked in python 2.2:

xlApp = Dispatch("Excel.Application")
xlApp.Visible = 1
xlApp.Workbooks.Add()
xlApp.ActiveWorkbook.SaveAs(sys.path[0] + '\\temp.xls')
wb = xlApp.Workbooks("temp.xls")
wbc = wb.VBProject.VBComponents # <---- CAUSES CRASH IN 2.3
xlApp.Quit()
del xlApp

but I get a GPE in 2.3, when the code finishes execution:
EXCEL caused an invalid page fault in
module OLE32.DLL at 0167:65f18ae3.

If you comment out the line 
wbc = ...
then I get no GPE.
Any ideas?




More information about the Python-list mailing list