ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Using Excel Solver in VBA (https://www.excelbanter.com/excel-programming/353345-using-excel-solver-vba.html)

Antoine Cellerier

Using Excel Solver in VBA
 
Hello,

I'm trying to use this simple code in Excel VBA:
SolverReset
SolverOk SetCell:="$A$13", MaxMinVal:=2, ValueOf:="0", ByChange:="$A$7"
SolverSolve

Unfortunately it seems that these functions aren't known. So i browsed
the web a little and found out that i needed to activate the Solver in
"Tools-References...". I couldn't find it in the list so i clicked
"Browse" and selected SOLVER32.dll in F:\Program Files\Microsoft
Office\OFFICE11\Library\SOLVER . Unfortunately that doesn't work (i get
a "Can't add a reference to the specified file" error message.

This is using Excel 2003 3 month trial. The solver works fine in Excel,
it's just the VBA part that i can't get to work.

Many thanks for your help,

--
Antoine Cellerier

Antoine Cellerier

Using Excel Solver in VBA
 
Hum, that's weird. Using the Browse button didn't work but it added a
"SOLVER" item in the list, which can be loaded. The weird part is that
it still doesn't work using Browse ...

Anyways .... it should work now.

--
Antoine Cellerier


All times are GMT +1. The time now is 04:39 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com