Search code examples
excelvbamacosexcel-2013excel-2011

Solver.xlam is missing?


I created a program in Excel 2010 on my PC that relies on the built-in solver for Excel. I made sure it worked on both Excel 2010 and Excel 2013 for PC. I then tried to use this same program on Excel 2011, and ran into an issue.

When I tried to compile the project, it says "Compile Error: Can't find Project or Library".

I remembered this happening on the PC side before I enabled the solver, so I went into Tools -> Add-ins and then enabled the Solver.Xlam.

Picture of the enabled Solver.Xlam

However, I got the same exact error.

I went into the developer side, and went to Tools -> Reference, and found that Solver.Xlam is missing.

Picture of the missing Solver.Xlam

I realized that the address it thinks the solver is at is where the solver is on my PC, but not where it is on OSX. When I search on OSX I find the solver is at /Applications/Microsoft Office 2011/Office/Add-Ins.

So I clicked "Browse" on the bottom and select Solver.Xlam.

Selecting Solver.Xlam

I select Solver.Xlam.

Solver.Xlam is now selected

But now I get a different error.

Error

After this error pops up, the location it is looking for Solver.Xlam at resets to the previous location.

What is the issue here? How do I go about solving this issue?


Solution

  • Look up This link to understand how it can be done

    But essentially you need to unload the addin and reload it , the following code will work

    Sub InstallAddIn()
         Installed = False 'to unload Add In
         Installed = True 'to load Add In
        Application.AddIns("AddIn Displayed Name").Installed = True  ' or False
    End Sub