Hello,

I've set up a Solver in an excel sheet, and I'm trying to create a macro that will initiate the Solver when the user clicks a textbox in the Excel sheet.

I recorded the macro and assigned it to the textbook. It runs splendidly on Excel 2010, but when I try to run it on Excel 2007, I receive the error message: "Solver: An unexpected internal error occurred, or available memory was exhausted." Unfortunately we only have Excel 2007 at the office, so I have to be able to make this work on Excel 2007.

I'm new to using VB, but I've checked the references and SOLVER is already checked. The Solver also works when I run it manually outside of the macro.

My current macro code is shown below. (FYI, code includes selecting the "'Set-up (DO NOT ALTER)" sheet where the data is located and then returning user to original "K calculator" sheet.)

Sub RunCalc() 

'  RunCalc Macro 
' 

' 
    Sheets("Set-up (DO NOT ALTER)").Select 
    Range("G13:G17").Select 
    SolverOk MaxMinVal:=1, ValueOf:="0", ByChange:="$G$13:$G$17" 
    SolverSolve 
    Sheets("K Calculator").Select 
End Sub

How do I fix this? I'd truly appreciate the assistance!