calling Solver .dll through VBA

vba-newbie

New Member
Joined
Jan 26, 2012
Messages
23
Hi,

I have been running Solver with this kind of code:

Code:
SolverOk SetCell:="$BM$3", MaxMinVal:=2, ValueOf:=0, ByChange:="$R$3:$R$9", _
        Engine:=1, EngineDesc:="GRG Nonlinear"
SolverOk SetCell:="$BM$3", MaxMinVal:=2, ValueOf:=0, ByChange:="$R$3:$R$9", _
        Engine:=1, EngineDesc:="GRG Nonlinear"
SolverSolve UserFinish:=True

Before I run this VBA, I will make the first Solver run manually, so that the conditions and constraints are properly set. This works fine, with the only problem being that it is very slow when I loop the VBA over, say, a few thousand times. This is understandable, because each manual run of the Solver usually takes about 1-2 seconds anyway.

The question that I would like to ask is, if I call the Solver .dll directly (which I suppose will bypass many GUI steps), will it make the program much faster? If it does, can someone please show me how to edit the above code to call the .dll? I am not familiar with using .dll files at all.

Thanks!
 

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top