I have a Python script which works outside of FME, but when run as a shut-down script produces the following error:
Python Exception <ImportError>: No module named win32api
The script is as follows.
import win32com.client Excel = win32com.client.Dispatch("Excel.Application") Excel.Visible = False ThisWorkbook = Excel.Workbooks.Add("S:\OS PARTNER DATA\FME_Workspaces\QuoteForm.xls") ThisSheet = ThisWorkbook.ActiveSheet ThisSheet.Cells(4,7).Value = 'Test' ThisSheet.Cells(10,3).Value = 'Matt' ThisSheet.Cells(13,2).Value = 'Mastermap' ThisWorkbook.ExportAsFixedFormat(0, 'S:\\OS PARTNER DATA\\FME_Workspaces\\name.pdf') ThisWorkbook.Saved = False Excel.DisplayAlerts = False Excel.Quit() del Excel
This is needed as I need to insert values into specific excel cells - as it fills in a quote template. Values are extracted from FME - but they have been replace by test strings in the above. I dont think this specific cell entry can be done with an excel writer?
I think it will not run in FME due to it using a different Python intepreter, but changing the interpreter brings up the error - Python Interpreter could not be loaded. I tried C:\Windows\SysWOW64\python27.dll.
Any suggestions on how I can install the win32api module in the FME python interpeter library or why it cannot seem to load a different interpreter?