Hi Mike,
It doesn't display any dialog box rather it gives a temporary name to the file.
Ex
newsheet.xls as newsheet1.xls
So i'm not able to save it. Is there an alternative to invoke the macro and save the file from my script itself .(saving it through macro wud be a better option : ) )
Thanx and Regards,
arun
On 4/21/06, Mike Hansen <[EMAIL PROTECTED]> wrote:
In the macro, you might try Application.DisplayAlerts = False and reset it to True after you save.I think it might be trying to display a dialog box before it saves.Mike
From: [EMAIL PROTECTED] [mailto: [EMAIL PROTECTED]] On Behalf Of arun
Sent: Friday, April 21, 2006 1:44 AM
To: tutor@python.org
Subject: Re: [Tutor] Invoking Excel Macro
I'm sorry , there is something realy wrong with 'Run-time error 1004':. I have fixed it now but still it throws an error while trying to save the workbook.
On 4/21/06, arun <[EMAIL PROTECTED]> wrote:Hi,I tried invoking a macro from my python script and It is throwing an error message that reads 'Run-time error 1004':"This operation requires the merged cells to be identically sized"My script looks like thisfrom win32com.client import Dispatch
xl = Dispatch('Excel.Application')
xl.Workbooks.Add('E:\Templates\sample.xls')xl.Run('Import_file') # name of the macroAlso while (running the macro)opening the workbook it names it as "sample1.xls' ,and soIt says there is no such file sample.xls"Filename = Myexcel.xlsWorkbooks("sample.xls").SaveAs Filename"Can somebody help me with this issue : (Thanxarun
--
arun
--
arun
_______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor