Question

open excel workbook on shutdown tcl / python


Badge +1
I have a routine that writes data into rows in Excel through a workspace runner but once the routine is finished I want FME to open the spreadsheet. 

 

 

I have looked at both python and TCL but can't get anything to work without runtime errors. 

 

 

Does anyone have any scripts I would use to simply open an xlsx in a shutdown script. 

 

 

4 replies

Badge +3
Hi, you can use in start up:

 

 

   set filename {yourfilenameinclpath}

 

   set shortname [file attributes $filename -shortname]

 

   exec cmd.exe /k start $shortname &

 

 

 

 
Badge +1
In a Python shutdown script in Windows the following works:

 

 

import os

 

os.system("Book1.xlsx") # Assuming your filename is Book1.xlsx

 

 

If this doesn't work, you can include the "start" word:

 

 

import os

 

os.system("start Book1.xlsx")

 

 

If your XLSX is in another directory than your FME script, give it an absolute path.
Badge +3
shutdown i ment, and it is a tcl snippet
Badge +1
Many thanks for both Gio and JimO's responses. It is now working using the Python script

 

 

import os

 

os.system("Book1.xlsx")

 

 

 

Reply