Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Solver activates other worksheets - why?
Solver in Excel 2002: I have a solver model on the DeNorm worksheet as
shown in code below. Note the two lines setting a global variable called BypassEvents. On the DeNorm, FitPlot and CapPlot worksheets, in their Worksheet_Activate and Worksheet_Deactivate modules, I have the beginning line If BypassEvents then Exit Sub Why do I need this? Because the SolverSolve routine activates and de-activates each of these worksheets at least once each time it is called, creating all kinds of havoc unless the event modules are bypassed. The FitPlot worksheet has another solver model on it, but the CapPlot worksheet doesn't. The cells in the DeNorm solver model do not refer in any way to anything on those other worksheets. What gives? Why is SolverSolve doing this, and is there a more direct way to stop it? Thanks, Ken Dahlberg Private Sub FitButton_Click() Application.ScreenUpdating = False Application.Calculation = xlCalculationManual BypassEvents = True SolverReset Application.ScreenUpdating = False SolverOK setCell:=Range("Q40"), _ MaxMinVal:=2, _ ByChange:=Range(ParmRange) ' ParmRange is a string defining Application.ScreenUpdating = False ' Changing Cells for the model. SolverSolve UserFinish:=False BypassEvents = False Application.Calculation = xlCalculationAutomatic Application.ScreenUpdating = True End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
IF statement based on True/False that activates a certain list box | Excel Worksheet Functions | |||
redo function loss after auto-save (just installed) activates. | Excel Discussion (Misc queries) | |||
selection from dropdown list activates hyperlink | Excel Discussion (Misc queries) | |||
Special Menu activates Web Toolbar | Excel Discussion (Misc queries) | |||
Interesting Solver problem (Solver encounters an error) | Excel Discussion (Misc queries) |