Using Vensim within Excel

Use this forum to post Vensim related questions.
Post Reply
KateO
Junior Member
Posts: 4
Joined: Wed Apr 14, 2004 3:24 pm

Using Vensim within Excel

Post by KateO »

I am hoping to run Vensim using Excel VBA. My model has time series data in Excel accessed with GET XLS DATA functions but I currently can't get the VBA code to run the model ("Problem encountered..". Is it physically possible to do this? Does anyone have any advice on the best way of managing the process in terms of .csv, .dat and/or .tab files? Many thanks, Kate
Administrator
Super Administrator
Posts: 4827
Joined: Wed Mar 05, 2003 3:10 am

Post by Administrator »

The attached zip file contains a demo model using GET XLS DATA, GET XLS CONSTANTS and also controlling Vensim from Excel.

Is this what you are trying to do?

Tony.

PS. Let me know if the zip file downloads ok, I seem to be having a few problems with attachments.
Attachments
KateO_Excel.zip
(11.08 KiB) Downloaded 803 times
KateO
Junior Member
Posts: 4
Joined: Wed Apr 14, 2004 3:24 pm

Post by KateO »

The zip file opens when I click on the link but it appears to be empty.
Administrator
Super Administrator
Posts: 4827
Joined: Wed Mar 05, 2003 3:10 am

Post by Administrator »

Here's the model.
Attachments
BALL_1.MDL
(3.68 KiB) Downloaded 169 times
Administrator
Super Administrator
Posts: 4827
Joined: Wed Mar 05, 2003 3:10 am

Post by Administrator »

Here is the excel file.
Attachments
DDESERV.XLS
(30 KiB) Downloaded 155 times
KateO
Junior Member
Posts: 4
Joined: Wed Apr 14, 2004 3:24 pm

Post by KateO »

Thanks Tony.
It seems that using the DDE links results in Vensim being open and running in the background. What I'd really like to do is keep Vensim hidden throughout and the
Excel97 example in Vensim seems to be more appropriate. Going back to my original query, do you know whether
it is physically possible to do this? Or, will I have to create .tab files or similar in order to run the model using time series input data?

Thanks.
Administrator
Super Administrator
Posts: 4827
Joined: Wed Mar 05, 2003 3:10 am

Post by Administrator »

Someone else did try this and failed. Using the Vensim DLL from Excel will not work, it would be trying to create a DDE link to itself as Excel would be the host application.

Tony
Post Reply