How to Fix Excel Solver Compile Error in Hidden Module SolverCode
Question details
The user encounters a compile error related to the hidden module 'SolverCode' when trying to use the Excel Solver add-in.
- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- Attempting to run the Solver add-in or the SOLVER.XLAM!GetGroupLabel macro in Excel.
- Observed behavior
- Excel displays 'Compile error in hidden module: SolverCode' and fails to execute the macro or open the Solver tool.
Ensure your Microsoft Office suite and Windows operating system are fully updated before attempting to troubleshoot add-in errors.
Re-enable Solver Add-in and Adjust Macro Security
Disabling and re-enabling the Solver add-in while ensuring macros are permitted can often resolve module compilation issues.
This error frequently occurs when the Solver add-in fails to load correctly due to a temporary glitch or restrictive macro security settings in the Trust Center.
Open Microsoft Excel, click on the 'File' tab in the top-left corner, and select 'Options' at the bottom of the menu.
In the Excel Options window, click on 'Add-ins' on the left pane. At the bottom, ensure 'Excel Add-ins' is selected in the Manage dropdown, then click 'Go'.
Uncheck the box next to 'Solver Add-in', click 'OK', and completely close Microsoft Excel.
Reopen Excel, return to the Add-ins menu, check the 'Solver Add-in' box, and click 'OK' to reload the module properly.
Navigate to File > Options > Trust Center > Trust Center Settings > Macro Settings, and ensure that macros are not completely disabled without notification.
Consult VBA Communities for Architecture Conflicts
If standard troubleshooting fails, the issue may stem from a 32-bit/64-bit Office architecture mismatch requiring specialized VBA advice.
Try WPS Office for a Stable and Compatible Spreadsheet Experience
If Excel add-ins and VBA modules frequently crash or fail to compile, consider switching to WPS Office. It provides a lightweight, highly compatible spreadsheet tool that seamlessly handles Microsoft Excel formats and complex data analysis without the heavy system requirements.
- 1. Download the Software: Visit the official WPS website to download and install the free WPS Office suite.
- 2. Open Your Files: Launch WPS Spreadsheet and seamlessly open your existing Excel workbooks.
- 3. Analyze Data: Use the stable, built-in data analysis tools located under the Data tab without worrying about hidden module errors.

Frequently Asked Questions
What causes the 'hidden module: SolverCode' error in Excel?
This error typically occurs when there is a compatibility issue between the Solver add-in (SOLVER.XLAM) and the specific version or architecture (32-bit vs 64-bit) of Microsoft Office installed on your device.
Will repairing Microsoft Office fix VBA module compilation errors?
Yes, running an Online Repair from the Windows Control Panel can often restore corrupted, outdated, or missing Office files that prevent VBA add-ins like Solver from compiling correctly.
Does WPS Office have an alternative to Excel's Solver?
Yes, WPS Spreadsheet includes robust data analysis tools, providing a stable and highly compatible alternative for complex optimization problems and data evaluation.




