i'm using win32 python library automate excel doc generation. i'm using jenkins run python script generate doc.
i'm facing problem "saveas" function. whenever run python script local machine generates , saves doc successfully. however, when trigger script jenkins, fails when "saveas invoked".
this simple python code:
import win32com.client win32 win32com.client import dispatch win32com.client import constants excel = win32.gencache.ensuredispatch('excel.application') excel.visible = false excel.displayalerts = false wb = excel.workbooks.add() wb.saveas(r"d:\helloworld.xlsx") excel.quit() as can see in both pictures, python invocation same, yet succeeds on local machine.
notes:
tried changing jenkins user system local account nothing worked.
tried chmod file directory didn't work either.
update: need add checkboxes in excel sheet, , far know possible through comtypes library or pywin32 library. if there other options please direct me.
try writing excel without using com object.
i recommend xlsxwriter there other alternatives
Comments
Post a Comment