VBA & Macro Problems

How to Add a Missing Solver Reference to an Excel VBA Project

John WilsonJohn Wilson Nov 3, 2026 870 views

Question details

The user needs to add the Solver reference (Solver.xlam) manually in the Excel Visual Basic Editor because it is missing from the default references list.

How to Add a Missing Solver Reference to an Excel VBA Project
Product
Excel
Device & OS
not provided
Scenario
Writing or running VBA macros that require the Excel Solver add-in functions.
Observed behavior
Solver is enabled in Excel, but it does not appear in the Tools > References list within the Visual Basic Editor, causing VBA macro compilation errors.
Before you start

Ensure that the Solver add-in is actually enabled in the main Excel application before attempting to add its reference in the Visual Basic Editor.

Solution 1Recommended

Manually Browse and Add Solver.xlam in VBA References

Locate the Solver.xlam file on your hard drive and manually add it to the VBA references.

If the Solver add-in is enabled in Excel but missing from the Visual Basic Editor, the fastest fix is to manually browse to the Microsoft Office Library folder and select the Solver.xlam file.

1
Open the VBA Editor

Press Alt + F11 on your keyboard to open the Visual Basic Editor in Excel.

2
Access the References Menu

Click on 'Tools' in the top menu bar, then select 'References' from the dropdown list.

3
Browse for the File

In the References dialog box, click the 'Browse...' button.

4
Navigate to the SOLVER Folder

Navigate to the Microsoft Office Library SOLVER folder. The path is typically 'C:\Program Files\Microsoft Office\root\Office16\Library\SOLVER' or '\Program Files\Microsoft Office\Office14\Library\SOLVER', depending on your Office version.

5
Select and Add Solver.xlam

Select the 'Solver.xlam' file, click 'Open', and then ensure the box next to 'Solver' is checked in your References list before clicking 'OK'.

Manually Browse and Add Solver.xlam in VBA References
Reference Added Successfully: Once added, the VBA project will successfully recognize Solver functions and your macro will compile without missing reference errors.
Free Microsoft Office alternative

Try WPS Office for Seamless Spreadsheet Management

Experiencing frustrating missing library paths or VBA reference errors in Microsoft Excel? WPS Office provides a free, lightweight, and highly compatible alternative with powerful built-in spreadsheet features, a familiar interface, and broad format support.

  1. 1. Download WPS Office: Visit the official WPS Office website and click the free download button.
  2. 2. Install the Software: Run the lightweight installer and follow the on-screen prompts to set up the software.
  3. 3. Open Your Excel Files: Launch WPS Spreadsheets and open your existing .xlsx files directly with full formatting retained.
Fully compatible with Microsoft Excel (.xlsx, .xls, .csv) formats.Lightweight installation with zero complex missing library path issues.Includes built-in advanced data analysis tools without extra downloads.Familiar user interface ensuring zero learning curve for Excel users.
microsoft office alternative - wps office

Frequently Asked Questions

Where is the default folder for Solver.xlam in Windows?

The Solver.xlam file is typically located in the Microsoft Office installation directory. Common paths include 'C:\Program Files\Microsoft Office\root\Office16\Library\SOLVER' for newer versions, or 'C:\Program Files (x86)\Microsoft Office\Office14\Library\SOLVER' for older 32-bit versions.

Why does Solver disappear from VBA references after an update?

Office updates can sometimes reset add-in configurations, change installation folder paths, or temporarily disable certain libraries. This requires you to re-enable the add-in in Excel options or browse for the reference manually in the VBA Editor.

Can I run Solver macros if the reference says 'MISSING'?

No. If the reference is marked as 'MISSING' in the VBA Editor, the compiler cannot find the Solver functions. Attempting to run the macro will trigger a compilation error until you remove the broken reference and link the correct file path.