Help: Exporting XLSX from VDFX via CMD script

Use this forum to post Vensim related questions.
Post Reply
Travis
Senior Member
Posts: 157
Joined: Tue Jul 15, 2008 8:42 pm

Help: Exporting XLSX from VDFX via CMD script

Post by Travis »

Should the following script work to export to XLSX? When I call it Vensim opens but then quickly closes. All the files are in the same directory. A XLSX file with the same name does already exist (and I'd like this script to always replace it).

[code]
SPECIAL>NOINTERACTION
MENU>VDF2XLSX|BAU.vdfx|BAU.xlsx|SaveList.lst|{||||
MENU>EXIT
[/code]
Administrator
Super Administrator
Posts: 4626
Joined: Wed Mar 05, 2003 3:10 am

Re: Help: Exporting XLSX from VDFX via CMD script

Post by Administrator »

Try running "MENU>VDF2XLSX|BAU.vdfx|BAU.xlsx|SaveList.lst|{||||" by itself and see if any error messages appear.
Advice to posters seeking help (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391

Units are important!
http://www.bbc.co.uk/news/magazine-27509559
Travis
Senior Member
Posts: 157
Joined: Tue Jul 15, 2008 8:42 pm

Re: Help: Exporting XLSX from VDFX via CMD script

Post by Travis »

I ran that single line in a new CMD file. Vensim opened with an error dialog what said, "Unable to open SaveList.lst to read variable names."

The LST file is in the same directory as the CMD, MDL, and VDFX files.
Travis
Senior Member
Posts: 157
Joined: Tue Jul 15, 2008 8:42 pm

Re: Help: Exporting XLSX from VDFX via CMD script

Post by Travis »

Aside: Is there a way to add comments to CMD files? "#" at the beginning of a line or something like that? This would be a nice feature, to comment code and/or comment command lines.
Travis
Senior Member
Posts: 157
Joined: Tue Jul 15, 2008 8:42 pm

Re: Help: Exporting XLSX from VDFX via CMD script

Post by Travis »

I tried removing the LST file from the line and now the error message says, "Unable to open BAU.vdfx to read data." Could it be some path issue?
Travis
Senior Member
Posts: 157
Joined: Tue Jul 15, 2008 8:42 pm

Re: Help: Exporting XLSX from VDFX via CMD script

Post by Travis »

Does this work on Windows? Is this a macOS problem? We'd love to have a workflow that runs the model and exports the data, but can't get by this step.
Administrator
Super Administrator
Posts: 4626
Joined: Wed Mar 05, 2003 3:10 am

Re: Help: Exporting XLSX from VDFX via CMD script

Post by Administrator »

Travis wrote: Thu May 16, 2024 6:30 pm I tried removing the LST file from the line and now the error message says, "Unable to open BAU.vdfx to read data." Could it be some path issue?
How are you using this (step by step please)?

Do you have a model open, then open the CMD script? Or some other way?
Advice to posters seeking help (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391

Units are important!
http://www.bbc.co.uk/news/magazine-27509559
Travis
Senior Member
Posts: 157
Joined: Tue Jul 15, 2008 8:42 pm

Re: Help: Exporting XLSX from VDFX via CMD script

Post by Travis »

Right now the test is simply the single line script that was suggested.

1. VensimDSS is closed.
2. In Terminal, I call the CMD script using the Vensim app, calling it with:

[code]
/Applications/VensimDSS.app/Contents/MacOS/VensimDSS "/full/path/in/quotes/script.cmd"
[/code]

3. Vensim opens and I get the above error message(s).

Note: I call another script the exact same way (to run scenarios) and it works. It is this exporting step that doesn't work.
aliakhavan89
Senior Member
Posts: 108
Joined: Sun Oct 21, 2018 7:09 am
Vensim version: DSS

Re: Help: Exporting XLSX from VDFX via CMD script

Post by aliakhavan89 »

Shouldn't there be a 'dot' before the file path? Like "./full/path/in/quotes/script.cmd"?
Administrator
Super Administrator
Posts: 4626
Joined: Wed Mar 05, 2003 3:10 am

Re: Help: Exporting XLSX from VDFX via CMD script

Post by Administrator »

Travis wrote: Fri May 17, 2024 3:43 pm Right now the test is simply the single line script that was suggested.

1. VensimDSS is closed.
2. In Terminal, I call the CMD script using the Vensim app, calling it with:

Code: Select all

/Applications/VensimDSS.app/Contents/MacOS/VensimDSS "/full/path/in/quotes/script.cmd"
3. Vensim opens and I get the above error message(s).

Note: I call another script the exact same way (to run scenarios) and it works. It is this exporting step that doesn't work.
I'll need to debug to test, but I think it's because there is no model loaded (and so, the active folder is not set correctly). I'll test at some point next week.
Advice to posters seeking help (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391

Units are important!
http://www.bbc.co.uk/news/magazine-27509559
Travis
Senior Member
Posts: 157
Joined: Tue Jul 15, 2008 8:42 pm

Re: Help: Exporting XLSX from VDFX via CMD script

Post by Travis »

This morning even my script to run a scenario won't work, with an error stating it can't find the model file. Appreciate your help.
Travis
Senior Member
Posts: 157
Joined: Tue Jul 15, 2008 8:42 pm

Re: Help: Exporting XLSX from VDFX via CMD script

Post by Travis »

Any update on this? Anything else I can do to test?
Administrator
Super Administrator
Posts: 4626
Joined: Wed Mar 05, 2003 3:10 am

Re: Help: Exporting XLSX from VDFX via CMD script

Post by Administrator »

Not yet. I'm back in the office next Wednesday, so will get to it then (I don't have my Mac with me).
Advice to posters seeking help (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391

Units are important!
http://www.bbc.co.uk/news/magazine-27509559
Travis
Senior Member
Posts: 157
Joined: Tue Jul 15, 2008 8:42 pm

Re: Help: Exporting XLSX from VDFX via CMD script

Post by Travis »

(Hope your time away was for fun!)

I'm happy to help pick this up when you're ready. Just let me know what to test.
Travis
Senior Member
Posts: 157
Joined: Tue Jul 15, 2008 8:42 pm

Re: Help: Exporting XLSX from VDFX via CMD script

Post by Travis »

I've installed the newer build that you sent me but I still can't get VDF2XLSX to work. I can simulate a scenario again (which was broken a few posts earlier in this thread).

Can you send me a script in which VDF2XLSX works on macOS?
Post Reply