View Single Post
  #21   Report Post  
Posted to microsoft.public.excel.programming
Peter T[_8_] Peter T[_8_] is offline
external usenet poster
 
Posts: 88
Default Problem loading Solver


"programmernovice" wrote in message
Thanks Peter & Garry. I tried following all instructions, even removing
and re-adding Excel in Programs & Features (Windows 10) Now can't run the
following script:

solverok setcell:=Range("Collect.xlsm!absDif"), maxminval:=2,
valueof:="0", bychange:=Range("Collect.xlsm!absDif").Offset(0, -1)
solverSolve (True)
solverfinish (True)

I get:

Compile error:
Can't find project or library

Any ideas? Thanks for your patience, fellows!


I failed to mention that the script shown was obtained by recording the
procedure under the Record macro option of Excel 2007.


As Claus said you need to add a reference to the solver addin, though in an
English system if would be in Tools / References, not "Extras" :)

If solver.xlam is already loaded tick "SOLVER" which you should see near the
top of the list. But just for this it doesn't need to be loaded or installed
as an addin, just browse to the file in References. In future it should load
automatically with your file if not already loaded.

Peter T