Article ID: 116340
Article Last Modified on 10/11/2006
' Macro to call Solver main dialog box.
Sub MainSolverDialog()
' Turn error checking off.
On Error Resume Next
' Test if Solver add-in is already open.
If Application.IsNA(Workbooks("Solver.xla").Name) Then
' If add-in is not open, then open Solver.xla.
' NOTE: You may need to adjust the path to Solver.xla.
' For example, the path may be
' C:\MSOffice\Excel\Library\Solver\Solver.xla.
Workbooks.Open ("C:\Excel\Library\Solver\Solver.xla")
' Run Solver auto open macro to load add-in.
Application.Run ("Solver.xla!Auto_Open")
' Ends the If statement.
End If
' Turn error checking back on.
On Error GoTo 0
' Run the Solver macro to display the main Solver dialog box.
Application.Run ("Solver.xla!Do_Main")
' End the macro.
End Sub
NOTE: You may need to adjust the path to Solver.xla.
A1: Solver Main Dialog
A2: =IF(AND(ISNA(DOCUMENTS(2,"SOLVER.XLA"))))
A3: =OPEN("C:\EXCEL\LIBRARY\SOLVER\SOLVER.XLA")
A4: =Run("Solver.xla!Auto_Open")
A5: =END.IF()
A6: =RUN("SOLVER.XLA!Do_Main")
A7: =RETURN()
Description of macro:
A1: Name of macro.
A2: Check to see if Solver is already opened.
A3: If Solver is not open, open it.
A4: Run Solver's auto open macro to load the add-in.
A5: End the If function in A2.
A6: Run the 'Do_Main' macro in the Solver add-in.
A7: End the macro.
For the above macro to work with Microsoft Excel for the Macintosh, replace the MS-DOS style file name with the appropriate Macintosh style file name (for example, "Macintosh HD: Microsoft Excel: Macro Library: Solver: Solver Add-In").
Additional query words: 4.0a 5.00xlm kbmacro
Keywords: kbhowto kbprogramming KB116340