Tools References...
Try this one. Note that this doesn't need a reference to the VBE
Extensibility.
Sub SolverInstall()
Dim oWB As Workbook
Dim strSolverPath As String
On Error Resume Next
Set oWB = ActiveWorkbook
strSolverPath = Application.LibraryPath & "\SOLVER\SOLVER.XLA"
'to load the .xla
With AddIns("Solver Add-In")
.Installed = False
.Installed = True
End With
'to set the reference
oWB.VBProject.References.AddFromFile strSolverPath
End Sub
RBS
"Gary''s Student" wrote in message
...
I distributed a macro that uses Solver. I supplied instructions to the
users
to make sure the Solver checkbox in Tools References... was checked
before
trying the macro.
A significant number of people called saying the macro did not work
(meaning
they ignored the instructions).
Is there any way for the macro to switch on the reference itself??
--
Gary''s Student - gsnu2007xx
|