Changing vdf data sources from Excel using dll

Use this forum to post Vensim related questions.
Post Reply
drw
Member
Posts: 40
Joined: Wed Mar 25, 2009 1:10 pm

Changing vdf data sources from Excel using dll

Post by drw »

Hi Folks,

Looking to understand what would be the recommended way to change a vdf input data source when interacting with a vensim package file using vensim_dll from Excel please. With Excel files, one can use the "SIMULATE>SPREADALIAS" command to change the input xls file (to use with say GET XLS DATA). However, is there an equivalent where you can change the input string for a vdf file from Excel?

By way of context, we have a single string variable which has the filename and path to use for any GET VDF DATA calls, but looking for a way to be able to manipulate that on the fly when running from Excel.

Many thanks,
Dave
tomfid
Administrator
Posts: 3806
Joined: Wed May 24, 2006 4:54 am

Re: Changing vdf data sources from Excel using dll

Post by tomfid »

I would recommend importing the spreadsheet to a vdf and using ordinary data variables rather than the GET VDF functions. Then you can control the data source via SIMULATE>DATA| and ADDDATA.
drw
Member
Posts: 40
Joined: Wed Mar 25, 2009 1:10 pm

Re: Changing vdf data sources from Excel using dll

Post by drw »

Thanks a lot, those commands look like they could be a winner. For my understanding, when using results from another model run I need to export them as a *.DAT file first and then convert them to a vdf/vdfx to be read in as a data source (i.e. you cannot directly link to the results from another model run without the export and conversion process)?

Thanks,
Dave
tomfid
Administrator
Posts: 3806
Joined: Wed May 24, 2006 4:54 am

Re: Changing vdf data sources from Excel using dll

Post by tomfid »

Nope - a vdf output from one model can be read directly as input to another model. No conversion needed - you just need to have matching variable names.
drw
Member
Posts: 40
Joined: Wed Mar 25, 2009 1:10 pm

Re: Changing vdf data sources from Excel using dll

Post by drw »

That's great news. Thanks.
Post Reply