Skip to main content
Question

open excel workbook on shutdown tcl / python


bubblebeb
Contributor
Forum|alt.badge.img+6
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

gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • March 4, 2015
Hi, you can use in start up:

 

 

   set filename {yourfilenameinclpath}

 

   set shortname [file attributes $filename -shortname]

 

   exec cmd.exe /k start $shortname &

 

 

 

 

  • March 4, 2015
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.

gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • March 5, 2015
shutdown i ment, and it is a tcl snippet

bubblebeb
Contributor
Forum|alt.badge.img+6
  • Author
  • Contributor
  • March 6, 2015
Many thanks for both Gio and JimO's responses. It is now working using the Python script

 

 

import os

 

os.system("Book1.xlsx")

 

 

 

Reply


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