[python-win32] Running Excel Macros from Python

Bob Gailer bgailer at alum.rpi.edu
Thu May 15 13:39:10 EDT 2003


At 08:11 PM 5/15/2003 +0200, thor vollset wrote:

># this script runs the "Skrivut883" macro
># when excels quits - the user are prompted to save - is there a way to 
>avoid this prompt?
>
>from win32com.client import Dispatch
>myExcel = Dispatch('Excel.Application')
>myExcel.Visible = 1
>myExcel.Workbooks.Add('c:\Termoetiketter1_2.xls')
>myExcel.Run('Skrivut883')
>myExcel.Quit()

The macro should either save or close the workbook.

Bob Gailer
bgailer at alum.rpi.edu
303 442 2625
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/python-win32/attachments/20030515/5fd2a683/attachment.htm


More information about the Python-win32 mailing list