Vensim.dll not working on guest computer

Use this forum to post Vensim related questions.
Post Reply
megboyar
Senior Member
Posts: 55
Joined: Mon Nov 16, 2009 7:22 am

Vensim.dll not working on guest computer

Post by megboyar »

Hi,

I have worked out a file which runs a Vensim model from Excel.

However, when I pass the Excel and the published model along to other computers, it doesn't work. We get a prompt asking if we can open the .vpm in Model Reader and also says it can't find the .vgf .... but even if we put the .vgf in the same folder, still doesn't work.

Any advice much appreciated!

Best wishes,
Sarah
Administrator
Super Administrator
Posts: 4590
Joined: Wed Mar 05, 2003 3:10 am

Re: Vensim.dll not working on guest computer

Post by Administrator »

Have you published to a VPA file?

If yes, start the model reader, and open this. It will start Excel which in turn will open the model etc.
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
megboyar
Senior Member
Posts: 55
Joined: Mon Nov 16, 2009 7:22 am

Re: Vensim.dll not working on guest computer

Post by megboyar »

Here is an image of the error message when I try to simulate from Excel.
Forgive please the low resolution image.

Thank you,
Sarah
Attachments
error.jpg
error.jpg (12.6 KiB) Viewed 16030 times
megboyar
Senior Member
Posts: 55
Joined: Mon Nov 16, 2009 7:22 am

Re: Vensim.dll not working on guest computer

Post by megboyar »

As sorry, you responded before I realized.

You're right - I was trying to run it on the guest computer from a .vpm

Now, when I try and save as a .vpa
1. I select Package Type: Other (using Vensim.dll)
2. It tells me there are problems packaging
3. If I specify the caller as interface.xlsm
4. It tells me it has problems packaging the interface.xlsm

Any advice as to why it can't package a .vpa?

Many thanks,
Sarah
megboyar
Senior Member
Posts: 55
Joined: Mon Nov 16, 2009 7:22 am

Re: Vensim.dll not working on guest computer

Post by megboyar »

Ah, ok - I worked this out. For reference, it wouldn't package interface.xlsm because interface.xlsm was open (set to open automatically when you open the model.)

Best wishes,
Sarah
megboyar
Senior Member
Posts: 55
Joined: Mon Nov 16, 2009 7:22 am

Re: Vensim.dll not working on guest computer

Post by megboyar »

Can you please, very explicitly tell me how to save an Excel and a .mdl as a .vpa so that a guest can use it?

1. When I do this, do I choose the Excel as the caller?
2. Do I need to add the Excel files as an 'Additional File'

When I publish the model using the settings in the attached image, I get the following error message that 'Failed to open...' (also shown in attached image.)

Please help? This should be simple, right?

Thank you,
Sarah
megboyar
Senior Member
Posts: 55
Joined: Mon Nov 16, 2009 7:22 am

Re: Vensim.dll not working on guest computer

Post by megboyar »

Hi,

For reference, the steps/settings are as shown in the attached image.

This saves both the Excel and the model into one .vpa file. Note again that Vensim will not be able to publish the application if your Excel file is open.

When you open the published .vpa file with Model Reader, the Excel file automatically opens.

The one problem I'm still having is that when you first simulate Vensim prompts: "do you want to overwrite interface.xlsm with the package file?" I can't seem to stop it from doing this, so maybe need to put something into the VBA code or save it differently?

Best wishes,
Sarah
Attachments
howto.jpg
howto.jpg (62.33 KiB) Viewed 16023 times
megboyar
Senior Member
Posts: 55
Joined: Mon Nov 16, 2009 7:22 am

Re: Vensim.dll not working on guest computer

Post by megboyar »

This is the error I'm getting every time I simulate. Clicking "No" works around it, but very distracting.

Any advice much appreciated.

Best wishes,
Sarah
Attachments
error.jpg
error.jpg (22.79 KiB) Viewed 16023 times
Administrator
Super Administrator
Posts: 4590
Joined: Wed Mar 05, 2003 3:10 am

Re: Vensim.dll not working on guest computer

Post by Administrator »

I've experimented a bit. Unfortunately embedding the Excel spreadsheet in the VPA will always overwrite the one on disk. I cannot see a way around this for now (I'll add it as an enhancement for a future release (extract, but don't overwrite)).

So you will have to distribute two files, the spreadsheet and the .VPA.

Tony.
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
megboyar
Senior Member
Posts: 55
Joined: Mon Nov 16, 2009 7:22 am

Re: Vensim.dll not working on guest computer

Post by megboyar »

Hi Tony,

I don't mind distributing two files, but the problem still persists - because the only way to package the .vpa is to use the interface.xlsm files as the caller. So the .vpa opens the interface.xlsm from the package and then saves the interface.xlsm to the same folder as the .vpa.....I don't see how you can package a .vpa without incorporating the Excel file?

And then, once the .vpa is opened, the Excel files is saved to the same folder, and automatically creates a conflict with the Excel file in the .vpa package.

Am I missing something?

Many thanks.

Best wishes,
Sarah
Administrator
Super Administrator
Posts: 4590
Joined: Wed Mar 05, 2003 3:10 am

Re: Vensim.dll not working on guest computer

Post by Administrator »

I've got a solution, but it's a little "messy".

Create a file called launch.bat in the same directory as the model. Make the contents of this file

Code: Select all

launch excelfile.xls
Now make the caller "launch.bat". Include the Excel file within the package but select it and click "Extract" (see the screenshot). Create the VPA.

Now open this in the model reader. The model reader will call "Launch.bat" which will in turn launch the Excel file. "Extract" should only extract the Excel file on the first time the VPA is opened.

I've tested it here and it seems ok. Let me know how you get on.

Tony.
Attachments
publishsettings.jpg
publishsettings.jpg (57.08 KiB) Viewed 16009 times
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
megboyar
Senior Member
Posts: 55
Joined: Mon Nov 16, 2009 7:22 am

Re: Vensim.dll not working on guest computer

Post by megboyar »

Hi Tony,

I don't really know how to write a batch file. Here is my attempt.
It's obviously wrong, all I wrote is literally:

@echo off
launch interface.xlsm

The model doesn't seem to open either.

Thank you. I think your suggestion will work if I get this file right.

Best wishes,
Sarah
Administrator
Super Administrator
Posts: 4590
Joined: Wed Mar 05, 2003 3:10 am

Re: Vensim.dll not working on guest computer

Post by Administrator »

I've uploaded a zip file containing an example.

And try

Code: Select all

@echo off
start interface.xlsm
instead of

Code: Select all

@echo off
launch interface.xlsm
Attachments
2012-06-13 Demo Excel VPA model.zip
(82.44 KiB) Downloaded 228 times
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
megboyar
Senior Member
Posts: 55
Joined: Mon Nov 16, 2009 7:22 am

Re: Vensim.dll not working on guest computer

Post by megboyar »

Oh thank you! This is really interesting.

The solution I eventually came to was to use the phrase:

call interface.xlsm

and I didn't embed the interface in the *.vpa published package at all....so they exist as two files.

This was the only way I could stop the over-ride error message. Your solution didn't work for me for some reason....

But thank you so much for all the assistance.

Best wishes,
Sarah
Post Reply