Subscribe Bookmark RSS Feed

Update excel file in script

redneck

Community Member

Joined:

Jun 23, 2011

I am trying to update an excel file from data in a jmp table in a script. I know how to do this manually by using the save database command however when I try this in a script I get a that the 'file already exist'. When I use the manual save database command I do not get the 'file already exist' error. Any ideas? The command that shows up in the log and is what I've tried in my script looks like this:
DataTable("table") << Create Table ("DSN=Excel Files;C:\file.xlsx;DefaultDir=C:\; DriverId=1046;MaxBufferSize=2048;PageTimeout=5;","table name";

This command seems to write the file although I want to update the file. The manual method updates the file instead of trying to create it. I'm thinking it must be a simple fix.

Message was edited by: Redneck
3 REPLIES
KinKame

Community Trekker

Joined:

Nov 30, 2015

any hint for this old post? I am facing the same issue

 

thank you~

briancorcoran

Joined:

Jun 23, 2011

The interactive version does a "Drop Table" command before it does the Save Table.  Otherwise, the database will refuse the update.  If you want to do the replace through JSL, you'll need to perform the Drop Table.

 

Brian Corcoran

JMP Development

briancorcoran

Joined:

Jun 23, 2011

I believe you can also specify "replace" as a 3rd parameter to the Save Database JSL call and JMP will perform the Drop Table for you.

 

Brian