Thanks
---
Message posted from http://www.ExcelForum.com/
--
Regards,
Tom Ogilvy
"Tbeek >" <<Tbeek....@excelforum-nospam.com> wrote in message
news:Tbeek....@excelforum-nospam.com...
I am making a function that uses solver and I want to distribute it to
my colleagues but I don't want to have to go to their pc and turn
solver on and reference it. I would like the function to do it before
it calls solver.
If there was a good way to check that solver was installed and
referenced, I could also use that so the function wouldn't have to
install and reference solver every time the function was used in a
worksheet.
' Set a Reference to the workbook that will hold Solver
Set wb = ActiveWorkbook
SolverPath = Application.LibraryPath & "\SOLVER\SOLVER.XLA"
With AddIns("Solver Add-In")
.Installed = False
.Installed = True
End With
'Solver itself has 'focus' at this point.
'Make sure you point to the correct Workbook for Solver
wb.VBProject.References.AddFromFile SolverPath
End Sub
HTH. :>)
--
Dana DeLouis
Using Windows XP & Office XP
= = = = = = = = = = = = = = = = =
"Tbeek >" <<Tbeek....@excelforum-nospam.com> wrote in message
news:Tbeek....@excelforum-nospam.com...
--
Regards,
Tom Ogilvy
"Tbeek >" <<Tbeek....@excelforum-nospam.com> wrote in message
news:Tbeek....@excelforum-nospam.com...
Sub SolverInstall()
'// Dana DeLouis
Dim wb As Workbook
On Error Resume Next
' Set a Reference to the workbook that will hold Solver
Set wb = ActiveWorkbook
With wb.VBProject.References
.Remove .Item("SOLVER")
End With
With AddIns("Solver Add-In")
.Installed = False
.Installed = True
wb.VBProject.References.AddFromFile .FullName
End With
End Sub
--
Dana DeLouis
Using Windows XP & Office XP
= = = = = = = = = = = = = = = = =
"Dana DeLouis" <del...@bellsouth.net> wrote in message
news:O4SkghKH...@TK2MSFTNGP10.phx.gbl...