VBA: Executing a Solver automatically

  • Hope someone can help...I have two spreadsheets, afile called Atis 1.xls contains the macro called "testloop". Data from column A is inserted into the Master.xls file, this file has several formulas which run off the value which is pasted, towards the bottom there is a Solver, at the moment I have to click on OK within the solver screen in order to execute the solver, once executed there are various results which are copied and pasted back in the Atis 1.xls file.


    What I would like is to have the Solver execute automatically as the macro runs without me having to click on OK 100's of times to force it to run.


    Does anyone have any ideas?

  • Sounds like you need Application.DisplayAlerts=False at the start of your macro (remember to set to true at the end of your macro)


    Post back if I've missed the point


    HTH

    <a href="http://www.mrexcel.com/relayforlife.shtml" target="new"><img src="http://www.myimgs.com/data/vonpookie/anne_relay.gif"></a>

  • To elaborate more:


    Code
    Application.DisplayAlerts = False
    Application.ScreenUpdating = False
    
    
    ' your code here
    ...
    Application.DisplayAlerts = True
    Application.ScreenUpdating = True


    Else a simpler approach (I think!)


    Code
    SolverSolve True


    HTH

    <a href="http://www.mrexcel.com/relayforlife.shtml" target="new"><img src="http://www.myimgs.com/data/vonpookie/anne_relay.gif"></a>

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!