Instead of opening Solver Excel starts up a sub from the VBA project

  • Thread starter Thread starter danail.gardev
  • Start date Start date
D

danail.gardev

Hi!

I have VBA code to set up and run Solver in Excel and it runs fine.
There is a weird thing happening though - when I try to run Solver
manually, i.e. through the Excel interface, it does not open but starts
up the one of hte subroutines of my VBA project. It is not a major
problem, but is really annoying and I cannot really run manually the
Sover to check it against the results of my code.

Any comment is appreciated!
 
Is the solver add-in enabled?

Check <Tools><Add-Ins> and ensure that the Solver check box is ticked.
 
Yes, the Solver add-in is enabled. I have a procedure that uses it and
it runs fine.
 
What is the name of the procedure that is started?

Have you modified the default behavior associated with the Solver menu
item?

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Multi-disciplinary business expertise
+ Technology skills
= Optimal solution to your business problem
Recipient Microsoft MVP award 2000-2007
 
No, I have not modified anything.
The name of the procedure is "Main".
 
The name of the procedure is "Main".

Don't know, so just throwing this idea out...
Solver has an internal procedure called "Main", and in earlier versions of
Excel caused an undocumented bug. Are you using an earlier version of
Excel?
Try changing you Subroutine to something other than "Main."
Again, just throwing out an idea...
 
Hey, Dana!
I changed the name of the procedure and Solver opens properly now.
Thank you for the suggestion. I use Excel 2003, but I guess with Excel,
as other things, bad habbits die hard.

Cheers!
 
Hi. Thank you very much for the feedback, especially that you are using
Excel 2003.
Glad it helped. :>)
A little off topic, but another good habit to get into with Solver is not to
use workbook names that have a space in them. In certain types of Solver
programming, Solver can not internally store the name of the workbook
correctly if it has a space in the name. Why, we'll never know. Just
another undocumented bug...err...I mean feature.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top