2

I have a problem that has a lot of variables and the normal excel solver takes a lot of time to solve the problem. I am using the excel opensolver as it is faster and more efficient. I tried to record a macro but could not see any code related to opensolver. I need to access open solver using VBA just like we do for normal excel solver.

Thanks in advance!

2 Answers 2

4

This is how I got it working for a toy optimization problem I just created:

  • Add the Opensolver reference to your VB project

References menu...

OpenSolver reference

  • Call the solver as in this example code:

    Sub Test_OpenSolver()
        OpenSolver.RunOpenSolver , False
        'Q: Why False as a Second parameter?
        'A: MinimiseUserInteraction If True, all dialogs and messages will be suppressed. Use this when automating a lot of solves so that there are no interruptions. Defaults to False
    End Sub
    
Sign up to request clarification or add additional context in comments.

Comments

1

OpenSolver does not have any ability to record macros; it is not a feature our users have ever requested. However it does have a well documented VBA interface; see http://opensolver.org under Using OpenSolver.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.