Newbie : Python and Excel

LeMAS 3141 at laposte.net
Sat May 24 16:30:45 EDT 2003


i'm trying to save an excel file to a CVS txt file format thru the com 
client interface and it's going pretty bad !!

== snippet ==

App = win32com.client.dynamic.Dispatch('Excel.Application')
Book = App.Workbooks.Open('aa.xls')
Book.SaveAs('bb',FileFormat = 'xlCSV')
App.close()

== end of snippet ==

it fails on something like <<

return self._oleobj_.InvokeTypes(0x11c, LCID, 1, (24, 0), ((12, 17), (12, 
17), (12, 17), (12, 17), (12, 17), (12, 17), (3, 49), (12, 17), (12, 17), 
(12, 17), (12, 17)),Filename, FileFormat, Password, WriteResPassword, 
ReadOnlyRecommended, CreateBackup, AccessMode, ConflictResolution, 
AddToMru, TextCodepage, TextVisualLayout)
pywintypes.com_error: (-2147352567, 'Exception occurred.', (0, 'Microsoft 
Excel', 'SaveAs method of Workbook class failed', 'C:\\Program Files
\\Microsoft Office\\Office\\1033\\xlmain9.chm', 0, -2146827284), None)

>Exit code: 1

>>


Any clues ?

thanks in advance




More information about the Python-list mailing list