A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
Hello Henrik Franz,
Thank you for reaching out in Microsoft Q&A forum.
I understand you’re facing an issue where the Solver add-in in Excel 2024 fails to load for new files and shows a compilation error, even though it works fine with older files.
The issue occurs only with new files. Ensure they are saved as .xlsx or .xlsm (not .xls). If using macros, enable Developer Mode and allow macros.
Here’s how to fix it:
Go to File > Options > Add-ins > At the bottom, select Excel Add-ins and click Go > Ensure Solver Add-in is checked. If unchecked, check it and click OK.
You can also try to fix that by repairing VBA references: Press Alt + F11 to open the VBA editor > Go to Tools > References > Look for Solver in the list: if marked as MISSING, uncheck it. Browse to Solver.xlam (usually in C:\Program Files\Microsoft Office\root\OfficeXX\Library\SOLVER) > Re-add the reference and click OK.Try to close Excel > Navigate to the Add-ins folder and delete Solver.xlam > Reinstall via Office Repair by go to Control Panel > Programs > Microsoft Office > Repair.
Try to update Office to fix the issue: File > Account > Update Options > Update Now.
If this still fails, you can manually register Solver by running this in the VBA Immediate Window: Application.AddIns("Solver Add-in").Installed = True
------------------------------------------------------------------------------------------------------------
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.