Choose Language Hide Translation Bar
Community Member

Update excel file in script

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
Community Trekker

Re: Update excel file in script

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


thank you~

0 Kudos

Re: Update excel file in script

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

Re: Update excel file in script

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.