Excel interface for Vensim

Use this forum to post Vensim related questions.
Post Reply
tangent
Member
Posts: 22
Joined: Wed Jun 25, 2008 7:07 am

Excel interface for Vensim

Post by tangent »

hi all

I have noticed a few people asking for code to connect Excel to Vensim. I have developed a general purpose Excel interface that delivers basic Vensim functionality (running scenarios and sensitivity analysis) and can be used on any model by changing variable lists on an Excel sheet.

Please email me if you want a copy of it.

Jen
tangent
Member
Posts: 22
Joined: Wed Jun 25, 2008 7:07 am

Post by tangent »

I have decided to post the files here rather than have people contact me as I have not been developing the interface further and several people have been sent the files already. I would appreciate any improvements, questions or comments to be posted here.

The interface has internal comments in cells and in the VBA code. It provides functionality to connect to any Vensim model but the example uses a slightly modified version of the Advertising demo model.

The VensimControl sheet is used to name the model, set timestep info and identify variables to be retrieved from the vensim model. The data is placed in the 'FromVensim' sheet. The 'ToVensim' sheet identifies the variables to be sent to the vensim model and the data source for those variables. All variables must be fully subscripted.

The interface provides scenario management and sensitivity analysis functionality.

The VBA code is in 3 modules. The Vensim and Interface modules control the model. I started writing code for a menu system but abandoned it, but the draft code is included as another module. Some code must be run as the workbook is opened and this is run from the Workbook_Open() macro, which calls InitialiseInterface.

The vba hard codes some addresses. Most of these occur in the control sheets and should not be affected by using the interface on other models. However, the scenario number is in cell E16 on the Input sheet. It is likely that adapting the interface to other models will involve changing this cell reference and the vba code will need to be changed.

This is intended to be used by people developing interfaces in Excel and models in Vensim DSS, for eventual use by others who are using the Vensim Model Reader to run the model from the Excel interface. Thus, the dll used is the single precision version.

Please post (or email me) questions, comments and suggestions.

[Edited on 18-9-2008 by tangent]

[Edited on 18-9-2008 by tangent]

[Edited on 27-9-2008 by tangent]
Attachments
Interface.zip
(180.56 KiB) Downloaded 347 times
Post Reply