Hi, everybody! I have an excel 2003 vba project referencing to SOLVER automation library that does not work in excel 2007. I am looking for the new library name and cannot find, any tips? Thank you!
I don't have Excel 2007. In earlier versions, Solver is an add-in that is not installed taking the "default" installation. You have to do a custom installation and check the Solver add-in.
Add a reference to solver.xlam (under program files/microsoft office/office12/library/solver) in the VB editor. You should then be able to record solver sessions with the macro recorder.
I just recorded the following simple session:
Code:
Sub Macro2()
'
' Macro2 Macro
'
'
SolverOk SetCell:="$B$4", MaxMinVal:=3, ValueOf:="0", ByChange:="$B$3"
SolverSolve
Range("B6").Select
End Sub
Also search the VBA help for solver.
The following link may also be helpful for running solver VBA in different versions of Excel: