[python-win32] com_error when creating excel sheet

Sandra Herman s_herman at web.de
Mon Aug 9 22:28:45 CEST 2004


Hi, 

The following script results in the error listed below:

import win32com.client
from win32com.client import Dispatch
x1App = Dispatch("Excel.Application")
x1App.Visible=1
x1App.Workbooks.Add()
x1Sheet=x1App.Sheets(1)
x1Sheet.Name="Sheet 1"
x2Sheet = x1App.Sheets(2)
x2Sheet.Name = "Sheeet 2"
x3Sheet = x1App.Sheets(3)
x3Sheet.Name="Sheet 3"

Traceback... line 8, in ? x2Sheet = x1App.Sheets(2)
...
com_error: (-2147352567, 'Exception occurred.', (0. None, None, None, 0, -2147352565), None)

Running Python 2.3.3 on XP. Excel 2002 installed.

Does anybody know what the solution to the problem is?

Thanks!
____________________________________________________
Aufnehmen, abschicken, nah sein - So einfach ist 
WEB.DE Video-Mail: http://freemail.web.de/?mc=021200



More information about the Python-win32 mailing list