Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations SSS148 on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reference to Solver in Excel 2007 1

Status
Not open for further replies.

yakpol

Structural
Jun 1, 2001
450
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!
 
Replies continue below

Recommended for 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:


Doug Jenkins
Interactive Design Services
 
Doug,
thank you for your help!

Yakov
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor