VBA Solver answers in 2007 but not in 2000

sahramjet

New Member
Joined
May 16, 2006
Messages
6
I have written a very simple solver code (see below) that runs fine in Excel 2007 but fails to give me a solution in Excel 2000. I can cycle through the code using F8 in the VB editor and there doesn't seem to be any errors. When I check the solver manually the constraint has been added (i.e. C4 must equal 1) but the target and reference cells have not been recorded.

I'm stumped! Can anybody help?

Sub Macro1()
AddIns("Solver Add-in").Installed = True
Application.Run "Solver.xla!SolverReset"
Application.Run "Solver.xla!SolverAdd", "$C$4", 2, "1"
Application.Run "Solver.xla!SolverOK", "$B$4", 3, "0.5", "$A$1:$A$2"
Application.Run "Solver.xla!SolverSave", "$B$1:$B$2"
Application.Run "Solver.xla!SolverSolve", True
Application.Run "Solver.xla!SolverFinish", 1
End Sub

Sean
 

Some videos you may like

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK

Watch MrExcel Video

Forum statistics

Threads
1,108,730
Messages
5,524,493
Members
409,584
Latest member
RedHelp

This Week's Hot Topics

Top