Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

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

Has anyone had any trouble using the SOLVER function in Excel XP VBA?

Status
Not open for further replies.

MrMeReturns

Technical User
Feb 11, 2003
6
CA
I have been trying to get the Solver to run in Excel XP VBA but I keep getting an error saying an unexpected error has occured or the machine has run out of resources.

Also the function text itself is acting a bit wierd. Instead of turning blue and capitalizing the appropriate letters like other functions, the solver function calls remain as if they were normal text - all lower case and black.

This is the peice of code that is giving me the error.

SolverOk SetCell:=ActiveSheet.Range("A1"), MaxMinVal:=3, ValueOf:="0", ByChange:=ActiveSheet.Range("A2")

Note I corrected the formatting manually.

If anyone has anyideas let me know please

MrMeReturns
 
Im thinking it's the quotes in ....ValueOf:="0"

try just ValueOf:= 0
 
Have you established a reference to the Analysis Toolpak in VBE? From Excel proper, you can add "Analysis ToolPak - VBA" as an AddIn, but I think there is also a route via Tools-References in the VBE. Can't seem to find it right now, though.
Rob
[flowerface]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top