View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Dana DeLouis[_3_] Dana DeLouis[_3_] is offline
external usenet poster
 
Posts: 690
Default VBA code to add a reference to solver

Sub SolverInstall()
On Error Resume Next
Dim wb As Workbook
Dim SolverPath As String

' 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 " wrote in message
...
I what a piece of VBA code that will add a reference to solver.
I would put it in a sub or function that uses solver

Thanks


---
Message posted from http://www.ExcelForum.com/