×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

How to determine if SOLVER Add In is installed

How to determine if SOLVER Add In is installed

How to determine if SOLVER Add In is installed

(OP)
My application is using Excel SOLVER and I have a reference to it in VBA. When program is run on the computer without SOLVER installed as a part of Office, the message: library is not found will appear. Debbuging with 'On Error' does not work since the error is found during compilation.
If anybody knows how to determine if SOLVER is installed beforehand? Thank you for the reponses!

Yakov

RE: How to determine if SOLVER Add In is installed

in XL97, I think you could probably get this answer by searching for solver.xla.

I'm not sure about a more graceful solution, but I'll give it some pondering.

RE: How to determine if SOLVER Add In is installed

this may help (to check whether solver.xla has been opened):
http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q291295

this talks about explicitly using solver.xla as a reference in XL2000, so I suppose that whether or not it is present may serve as a useful check.

here's another MS help doc that might be useful:

http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q116340

' 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

RE: How to determine if SOLVER Add In is installed

(OP)
Thansk, Ivy!
I got the idea. My confusion came from VBA counting only visible workbooks and ignoring add-ins. If you have one regular workbook and a few add-ins open the
workbooks.count = 1, and
strName = workbooks(2).name will cause an error. But apparently if you call add-in by the name ( workbooks("Solver.xla") ) it's still accessible.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources