Skip to main content
Question

open excel workbook on shutdown tcl / python

  • March 4, 2015
  • 4 replies
  • 36 views

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. 

 

 
This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, 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.

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")