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
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,163,477
Messages
5,831,909
Members
430,090
Latest member
bjonesh2o

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top