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

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.

Forum statistics

Threads
1,214,798
Messages
6,121,630
Members
449,041
Latest member
Postman24

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
Back
Top