[python-win32] Named parameters; Adding Excel sheet

A. S. the.gerenuk at googlemail.com
Wed Aug 10 12:15:28 CEST 2011


Hello!
I've worked with pywin32 and up to now inspecting the Excel macro editor and
translating commands worked fine, but now I cannot manage to add a sheet at
the correct position in Excel.

My test program is

from win32com.client import Dispatch

app=Dispatch("Excel.Application")
app.Workbooks.Add()
app.ActiveWorkbook.Sheets.Add(After=app.ActiveWorkbook.Sheets(3))

Which adds the sheet at the incorrect position. Is there a trick? How come
Excel gets confused?

Bernd
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-win32/attachments/20110810/d45bc767/attachment.html>


More information about the python-win32 mailing list