W
Wayne Stewart
I am trying to automate the Solver routine (Under the
Tools pull-down menu) using a VBA macro. I have succeeded
at setting the constraints and the various options using
the "SolverAdd" and "SolverOptions" commands. However,
the problem seems to be with the "SolverOK" command, where
the "Set Target Cell", "MaxMinValue", and "By Changing
Cells" fields are set. Solver does not seem to register
these values when the "SolveOK" command is used. Also,
when I use the "SolverReset" command followed
by "SolverAdd", and "SolverOptions" commands, no
parameters are passed to solver either.
The only way I can get the "By Changing Cells" cells
actually changing on the excel worksheet is to first
invoke solver manually (outside the macro), get the
solution by clicking "solve", then deleting the fields in
the solver dialog box, closing solver, and then running
the macro!
Is there a glitch with Excel? Is there a patch that can
be downloaded to fix this problem? I'm positive that my
syntax is correct (the help examples are very straight
forward).
I don't get any error messages when I run the macro. It
simply just doesn't present the solution on the worksheet.
Hope someone can help me!
Tools pull-down menu) using a VBA macro. I have succeeded
at setting the constraints and the various options using
the "SolverAdd" and "SolverOptions" commands. However,
the problem seems to be with the "SolverOK" command, where
the "Set Target Cell", "MaxMinValue", and "By Changing
Cells" fields are set. Solver does not seem to register
these values when the "SolveOK" command is used. Also,
when I use the "SolverReset" command followed
by "SolverAdd", and "SolverOptions" commands, no
parameters are passed to solver either.
The only way I can get the "By Changing Cells" cells
actually changing on the excel worksheet is to first
invoke solver manually (outside the macro), get the
solution by clicking "solve", then deleting the fields in
the solver dialog box, closing solver, and then running
the macro!
Is there a glitch with Excel? Is there a patch that can
be downloaded to fix this problem? I'm positive that my
syntax is correct (the help examples are very straight
forward).
I don't get any error messages when I run the macro. It
simply just doesn't present the solution on the worksheet.
Hope someone can help me!