Consulting

Results 1 to 8 of 8

Thread: Solver.xla

  1. #1

    Solver.xla

    Have a sub using solver.xla. The project has a reference to solver, but the location may vary and so it doesn't always find the addin..

    is there a way of declaring solver.xla explicitly?
    another solution?

  2. #2
    Site Admin
    Jedi Master
    VBAX Guru Jacob Hilderbrand's Avatar
    Joined
    Jun 2004
    Location
    Roseville, CA
    Posts
    3,712
    Location
    See if this works for you:

    AddIns("Solver Add-in").Installed = True

  3. #3
    It's already there, but doesn't do it all....
    I didn't write the program - I'm just a tester - so when I look at my references, it says that solver is missing.
    If this was Word, I would just refer to Word explicitly.. but I have no idea how to do it with this.

  4. #4
    Site Admin
    Jedi Master
    VBAX Guru Jacob Hilderbrand's Avatar
    Joined
    Jun 2004
    Location
    Roseville, CA
    Posts
    3,712
    Location
    Ok, well... If Solver is not installed then we may have trouble.

    Tools | Add-Ins...

    Is Solver in the list? If not then:

    Close Excel
    Insert Office CD
    Add or Remove Features
    Click the plus sign (+) next to Microsoft Excel for Windows
    Click the plus sign (+) next to Add-ins and Solver
    Select Run From My Computer
    Click Update Now

  5. #5
    ah.. so it happens because solver is completely uninstalled. If it's installed by Excel, but not checked, vba will still find it.

    hmm.. is there a way to force it's installation? I have a custom Excel install, so I'm not sure, but is it installed on the pc by default (just not checked in addins?)

  6. #6
    Site Admin
    Jedi Master
    VBAX Guru Jacob Hilderbrand's Avatar
    Joined
    Jun 2004
    Location
    Roseville, CA
    Posts
    3,712
    Location
    If you just choose the standard Office install, I don't believe that it will be installed. You have to choose it to be installed.

    If it is not chosen to be installed, it wil not be on the PC at all.

    If it is insalled, it will be in the Add-Ins list and VBA can find it and install/uninstall it for use.

  7. #7
    ok - I think I got what I needed... so if the user has it installed (and it HAS to be done on purpose), the macro will have no problems. But, if it's never been installed, then the code needs to tell the user - because the code can't force it.

  8. #8
    Site Admin
    Jedi Master
    VBAX Guru Jacob Hilderbrand's Avatar
    Joined
    Jun 2004
    Location
    Roseville, CA
    Posts
    3,712
    Location
    Right. You can do something like:

    On Error Resume Next
    AddIns("Solver Add-in").Installed = True
    If Err <> 0 Then
       MsgBox "Excel's Solver Add-in is not installed, " & _
       "You must install it from the Excel installation CD " & _
       "for this macro to function properly.", vbCritical, "Error"
        Exit Sub
    End If
    On Error GoTo 0

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •