Automatic Load Solver.xla
Automatic Load Solver.xla
(OP)
Dear All,
I realised that not all Excel comes with Solver.xla "checked" as default (in Visual Basic Module). As a result, some of the macro I wrote which uses solver will not work in those computers unless the user manually select the solver check box.
Hence, I am wondering if anyone could teach me how to write a script which load Solver.xla automatically as part of a macro.
Many thanks!
EK
I realised that not all Excel comes with Solver.xla "checked" as default (in Visual Basic Module). As a result, some of the macro I wrote which uses solver will not work in those computers unless the user manually select the solver check box.
Hence, I am wondering if anyone could teach me how to write a script which load Solver.xla automatically as part of a macro.
Many thanks!
EK





RE: Automatic Load Solver.xla
AddIns("Solver Add-In").Installed = True
DimensionalSolutions@Core.com
While I welcome e-mail messages, please post all thread activity in these forums for the benefit of all members.
RE: Automatic Load Solver.xla
I tried your method by uncheck the solver and run the line which you recommended but it does not work. Do I need to specify the path to the library etc?
Thanks again.
EK
RE: Automatic Load Solver.xla
AddIns("solver add-in").Installed = True
or
AddIns.Add("solver.xla").Installed = True
Note that the spelling and punctuation must be exact. The explicit version does require you to know the actual file name, which, for Solver, is not too hard to figure out.
TTFN
RE: Automatic Load Solver.xla
I tried the following code without checking the SOLVER.xla box manually and it won't work. Could you see anything wrong in the code?
The error message is:
"Compiled Error"
"Sub or Function Not Defined"
If I checked the solver.xla manually, it works fine.
Thanks again.
_____________________________
Sub Solver300()
' Solver used to solve stud with 300 spacing
'
AddIns("solver add-in").Installed = True
SolverReset
SolverOptions Iterations:=10000, Precision:=0.01
SolverOk SetCell:="$G$16", MaxMinVal:=3, ValueOf:="0", ByChange:= _
"$B$15,$B$17,$B$18,$B$19,$B$20,$B$21,$B$22,$B$23"
SolverAdd CellRef:="$G$17", Relation:=2, FormulaText:="0"
SolverAdd CellRef:="$G$18", Relation:=2, FormulaText:="0"
SolverAdd CellRef:="$G$19", Relation:=2, FormulaText:="0"
SolverAdd CellRef:="$G$20", Relation:=2, FormulaText:="0"
SolverAdd CellRef:="$G$21", Relation:=2, FormulaText:="0"
SolverAdd CellRef:="$G$22", Relation:=2, FormulaText:="0"
SolverAdd CellRef:="$G$23", Relation:=2, FormulaText:="0"
SolverSolve UserFinish = False
End Sub
___________________
RE: Automatic Load Solver.xla
TTFN
RE: Automatic Load Solver.xla
TTFN
RE: Automatic Load Solver.xla
RE: Automatic Load Solver.xla
Anyway, thanks for all your help and time.
EK