Hi,
In Excel 2010, how does one write VBA script to activate the solver dialog for the current workbook? This action does not record.
TX
Open Solver Dialog in Excel via VBA
-
- gamma jay
- Posts: 25455
- Joined: 17 Mar 2010, 17:33
- Location: Cape Town
Open Solver Dialog in Excel via VBA
Regards,
Rudi
If your absence does not affect them, your presence didn't matter.
Rudi
If your absence does not affect them, your presence didn't matter.
-
- Administrator
- Posts: 79365
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Open Solver Dialog in Excel via VBA
Make sure that you set a reference to Solver in Tools | References... in the Visual Basic Editor:
You can then use the Solver in VBA.
Reference: Using the Solver VBA Functions.
The individual articles contain examples.
You can then use the Solver in VBA.
Reference: Using the Solver VBA Functions.
The individual articles contain examples.
You do not have the required permissions to view the files attached to this post.
Best wishes,
Hans
Hans
-
- Administrator
- Posts: 79365
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Open Solver Dialog in Excel via VBA
Oops, sorry, I see that I didn't read your question carefully enough. You want to open the Solver dialog using code, but I have no idea how to do that.
Best wishes,
Hans
Hans
-
- gamma jay
- Posts: 25455
- Joined: 17 Mar 2010, 17:33
- Location: Cape Town
Re: Open Solver Dialog in Excel via VBA
Thanks for the replies. I have not found anything else on the web that reveals how to access the dialog. Since it's an addin, I don't think its possible. As you state...one can only access the Solver Functions. So code calculates the result internally without the need to show the dialog. One must obviously pass ranges/variables to the Solver functions directly.
TX.
TX.
Regards,
Rudi
If your absence does not affect them, your presence didn't matter.
Rudi
If your absence does not affect them, your presence didn't matter.
-
- 2StarLounger
- Posts: 196
- Joined: 31 Mar 2011, 03:41
- Location: Perth, Western Australia
Re: Open Solver Dialog in Excel via VBA
For Excel 2007 and earlier, you could use
SOLVER.Solver1.Main
to call the dialog box
Kevin
SOLVER.Solver1.Main
to call the dialog box
Kevin
-
- SilverLounger
- Posts: 2403
- Joined: 05 Feb 2010, 22:21
- Location: London ENGLAND
Re: Open Solver Dialog in Excel via VBA
I'm guessing here but I assume if the dialog is shown and the user clicks Solve there might not be a way to trap this event? That is, it just uses the Solver feature and we are not able to achieve anything with our Solver code. So we can either create our own UserForm version of the Solver dialog, or read necessary details/arguments from a worksheet.Becks wrote:For Excel 2007 and earlier, you could use
SOLVER.Solver1.Main
to call the dialog box
Kevin
But I may be wrong..? Andy.
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.