View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Joel Lack Joel Lack is offline
external usenet poster
 
Posts: 2
Default SolverOK / SolvOK function does not compile - SOLVER library is referenced

I want the solver function to automatically run when my worksheet is
activated. I initially recorded the process for convenience, but
received the "Compile error: Can't find project or library" message. I
checked my reference and discovered that I had not referenced SOLVER
yet in this project. But, the function still failed to compile after
adding the refernece.

I searched the groups for similar problems and found several threads on
the same situation, but only found one that suggested a bug in XP that
recorded the function name wrong as SolverOK but should be SolvOK.
However, neither of these are working for me. Has this issue been
further discussed? Is there a work around?

FYI:

I'm using Excel 2002 SP3

My code:

Private Sub Worksheet_Activate()

SolvOK SetCell:="$F$23", MaxMinVal:=2, ValueOf:="0",
ByChange:="$F$15"
SolverSolve

End Sub