win32com: How to use optional parameters?
Ilja Heitlager
news at heitlager.com
Tue Jul 11 06:35:44 EDT 2000
Ok, call me lazy, but until now I was unable to use optional parameters in
COM calls.
For example I would like to Add a new sheet in Excel at the end of all other
sheets. In Visual Basic I would use something like
xl.Worksheets.Add After:=xl.Worksheets.Count
Where the Add method accepts the following parameters
expression.Add(Before, After, Count, Type)
expression Required. An expression that returns a Worksheets object.
Before Optional Variant. An object that specifies the sheet
before which the new sheet is added.
After Optional Variant. An object that specifies the sheet
after which the new sheet is added.
Count Optional Variant. The number of sheets to be added. The
default value is one.
Type Optional Variant. The sheet type.
Trying something like xl.Worksheets.Add(After=xl.Worksheets.Count) in python
doesn't work.
Please help, otherwise I need to use a MoveAfter method written in VB and
call this with Application.Run(...)
Regards,
Ilja Heitlager
More information about the Python-list
mailing list