Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Using Solver in VBA in a loop

I have used Solver in VBA to solve optimization problems with good
results.
HOWEVER, when I tried to use it in a Monte Carlo For-Next loop, the
debugger highlights the 1st Solver function call.
So here are my questions:
1) Is it possible to execute Solver in a "For-Next" or other loop?
2) Has anyone tried anything similar?
Thanks,
Jim
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,582
Default Using Solver in VBA in a loop

It's possible and I've done it.

What's your first Solver function call? In fact, I don't see any code here
at all.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services, Inc.
http://PeltierTech.com/WordPress/
_______


"Jim" wrote in message
...
I have used Solver in VBA to solve optimization problems with good
results.
HOWEVER, when I tried to use it in a Monte Carlo For-Next loop, the
debugger highlights the 1st Solver function call.
So here are my questions:
1) Is it possible to execute Solver in a "For-Next" or other loop?
2) Has anyone tried anything similar?
Thanks,
Jim



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Using Solver in VBA in a loop

I found the secret.
Apparently loading the SOLVER sla has to be done for each workbook.
Once I did that, everything was fine.
Jim

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,582
Default Using Solver in VBA in a loop

The xla only needs to be initialized once the first time you use it. But the
model has to be set up for each sheet, because Solver stores the parameters
in the sheet.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services, Inc.
http://PeltierTech.com/WordPress/
_______


"Jim" wrote in message
...
I found the secret.
Apparently loading the SOLVER sla has to be done for each workbook.
Once I did that, everything was fine.
Jim



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
referencing Solver.xlam vs. Solver.xla - 2007 vs. 2003 Duke Carey Excel Programming 3 November 20th 07 03:48 PM
Need advice on Solver loop robs3131 Excel Programming 1 October 10th 07 06:35 PM
Interesting Solver problem (Solver encounters an error) MrShorty Excel Discussion (Misc queries) 3 December 22nd 05 10:52 PM
Automating Solver in loop msuryexcel Excel Programming 2 October 18th 05 03:24 PM
Error message when using the Solver in a VBA macro loop Mathieu Fournier Excel Programming 2 March 1st 05 02:36 PM


All times are GMT +1. The time now is 06:23 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"