View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
ChrisDub ChrisDub is offline
external usenet poster
 
Posts: 1
Default solver.xla problems migrating from Excel'97 to 2003

hi jon,

I'm not at work so I cannot give you the exact code (I will cut &
paste it tomorrow) but these are the commands used:

Application.ExecuteExcel4Macro "Solver.xla!solverreset()"
Application.ExecuteExcel4Macro "Solver.xla!solverok(plot!R46C4, 2, 0,
plot!r13c12:r14c12)"
Application.ExecuteExcel4Marco "Solver.xla!solverOptions(....)"
Application.ExecuteExcel4Macro "Solver.xla!solverok(plot!R46C4, 2, 0,
plot!r13c12:r14c12)"
Application.ExecuteExcel4Macro "Solver.xla!solverSolve()"

Other than the parameters for the SolverOptions line that is it except
that it is all in Uppercase in the original. It does nothing. I have
had a debug stop or a msgbox between every line and it makes no
difference, nothing happens. It was originally written in Excel '97 on
Win2000 and I am trying to make it run in Excel 2003 (Office 2003 SP2)
on winXP SP2.

If I change the code to use the VBA form, .e.g.
SolverReset
SolverOK "$D$46", 2, 0, "$L$13L$L$14",
etc
and add the reference and install the addin then it works fine. The
trouble is that does not help with the hundreds of spreadsheets
already created with the XLM-style code in it.

Thanks,
Chris

On 26 Mar, 18:02, "Jon Peltier"
wrote:
List all of the solver commands you're using, not this abbreviated one.
There may be one or two lines omitted which cause your issues.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutionshttp://PeltierTech.com
_______

"Deborah Digby" wrote in message

...

hi,


at work, we are currently upgrading from Win200 to XP and from Excel '97
to
Excel 2003. We have hundreds/thousands of spreadsheets that include in the
VBA projects code like:


Application.ExecuteExcel4Macro "Solver.xla..."


This no longer works in Excel 2003. It does not produce an error, but
seems
to do nothing. The code is easy to rewrite by adding a reference to
solver.xla and calling the functions as normal in VBA. The problem is that
I
would have to replace the code in all the hundreds/thousands of scientific
spreadsheets that have already been created. I need to have a solid
credible
reason to tell my boss why I am going to need a lot more time to do my
part
of the migration, more than just something like "I think Microsoft have
stopped supporting the old macro language". I need to KNOW. And that was
just a guess anyway. Does anyone know why the above code does not work in
Excel 2003, while it is fine in Excel'97? Also, is there a update/patch
available from Microsoft to fix the problem? Basically, is there any way I
can avoid having to rewrite the code?


Thanks in advance,
Chris