At 08:12 AM 1/10/2006, Stefan Elwesthal wrote: >Hi all! > >I have to ask, cause two days later I'm starting to get annoyed ;-) > >How could I use PythonCOM and save my re-worked Excel file as an >xlCSV file? All I get is >"SaveAs method in Worksheet class failed". > >Is something wrong with this line? >sh.SaveAs("C:\file.csv", FileFormat='xlCSV')
Yes. xlCSV is a Visual Basic for Excel NUMERIC constant, not a string. Try: sh.SaveAs("C:\file.csv", FileFormat=6) These constants are also available by name from the win32 package but I don't recall how to access them. What I do is get into Excel's VB, open the immediate window and type ?xlcsv. Viola, it displays 6. _______________________________________________ Python-win32 mailing list Python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32