Page 1 of 1

call a published DSS model via DLL from VBA code

Posted: Tue Oct 31, 2023 10:22 am
by MKui
We publish our model in DSS and only check the box ‘readable by DSS’. In our application Vensim DSS is called via a DLL from VBA code.
This gives the error ‘file blocked by this application’.

Via trial-and-error we now publish by also checking the box ‘readable by runtime’. The disadvantage of this is that we loose the functionality of being able to read the specific subscript element set from the database via GET ODBC SUBSCRIPT(); before publishing we have to reload the model with specific subscript element set and than publish it. So per subscript element set we have a separate vpmx file. For only DSS this should not be the case. DSS is able to work with ‘dynamic’ subscript element sets.
In your documentation we also read that ‘runtime’ is becoming obsolete.

What can you advice us on using DSS, publish only readable by DSS and calling DSS model via DLL from VBA, so we make use of the DSS functionality?

Re: call a published DSS model via DLL from VBA code

Posted: Thu Nov 09, 2023 12:21 pm
by MKui
Could you please give a reply on this topic?

Re: call a published DSS model via DLL from VBA code

Posted: Fri Nov 10, 2023 1:36 pm
by Administrator
GET...SUBSCRIPTS will not work in the DLL or Vensim Model Reader. Both the DLL and Model Reader require a fully working and parsed model, and the only way to guarantee that is to block calls to GET...SUBSCRIPTS functions.

The Vensim Model reader would not really be an option as you want to load via the DLL. The same restriction will be in place on the GET...SUBSCRIPTS functions.

Can you create the model with a standard set of subscripts, and then map these to labels in the user interface at runtime? That is how we used to do things in the past when needed.