Forum Discussion

danielt9402's avatar
danielt9402
Copper Contributor
Jun 23, 2025

Compile error in Hidden Module: SolverCode

Hi y'all,

 

As the title says, I keep getting this error whenever I try to use solver. I've tried redownloading microsoft office, but this didn't fix the issue. Any advice?

1 Reply

  • NikolinoDE's avatar
    NikolinoDE
    Gold Contributor

    You should not be seeing a Compile error in hidden module: SolverCode. That error usually means something is broken or corrupted in the Solver add-in or its related macro files.

     

    Disable and Re-enable the Solver Add-in

    This often clears the corrupted reference.

    1. Open Excel
    2. Go to File → Options → Add-ins
    3. At the bottom, next to Manage, choose Excel Add-ins and click Go...
    4. Uncheck "Solver Add-in"
    5. Click OK
    6. Go back and re-check "Solver Add-in" to re-enable it

    Then close Excel completely and reopen it.

    Or…

    Delete Corrupt Solver VBA Components (if they exist)

    You may have a corrupt file like SolverCode.bas or a leftover macro.

    1. Open Excel
    2. Press Alt + F11 to open the Visual Basic for Applications (VBA) editor
    3. Look in the Modules area for anything named SolverCode
    4. If it's there, right-click and remove it
    5. Close the VBA editor and try using Solver again

     

    If the issue persists Repair Office 365

    Go to Control Panel → Programs → Programs and Features

    Find Microsoft 365 → click Change

    Choose Quick Repair

    If that doesn’t work, try Online Repair

    Sometimes Excel caches control settings that can corrupt Solver.

    1. Press Windows + R to open Run
    2. Type:

    %appdata%\Microsoft\Forms 

         3. Delete all .exd files there

    Then relaunch Excel and try Solver again.

     

    I hope I could help

Resources