Skip to main content
Solved

Python Exception: No module named win32api

  • August 20, 2014
  • 1 reply
  • 53 views

Hello,

 

 

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?

Best answer by david_r

Hi,

 

 

here are a couple of links to get you started:

 

David
View original
Did this help you find an answer to your question?
This post is closed to further activity.
It may be a question with a best answer, an implemented idea, or just a post needing no comment.
If you have a follow-up or related question, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

1 reply

david_r
Evangelist
  • Best Answer
  • August 20, 2014
Hi,

 

 

here are a couple of links to get you started:

 

David

Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings