Excel Solver Add-in Error 1004 and "SolverCode" Compilation Error

Mouaid Al Dahr 0 Reputatiepunten
2025-08-08T06:40:58.77+00:00

Hello,

I'm experiencing persistent issues with the Solver add-in in Excel. Every time I try to use Solver, I receive Error 1004. I’ve tried multiple troubleshooting steps, including:

  • Using the online version of Excel, but the same error occurs.
  • Removing and re-adding the Solver add-in.
  • Verifying that Solver is correctly installed via Options > Add-ins.
  • Checking that the macro is correctly written.
  • Uninstalling and reinstalling the Solver add-in.
  • Performing a repair of all Microsoft Office apps, including Office 365.

Unfortunately, none of these steps resolved the issue.

Now, when trying to open Solver from a blank Excel file, I get a new error:

"Compilatiefout in verborgen module: SolverCode. Deze fout treedt meestal op wanneer code incompatibel is met de versie, het platform of de architectuur van deze toepassing."

This happens even when opening a new document and trying to launch Solver.

I got an answer from you guys: Go to C:\Users<YourUsername>\AppData\Roaming\Microsoft\Excel\XLSTART

  1. Look for SolverCode > delete .xlam and .xla
  2. Check if issue is still the same Note: Make sure excel is closed when doing this.

If issue is still the same, please reinstall Excel but this time, if you are using 64bit on the current installation, please try to download using 32bit version.
Screenshot_5

But it sadly none of these steps worked for me..Screenshot_6

Screenshot_5

Microsoft 365 en Office | Excel | Overige | Windows
0 opmerkingen Geen opmerkingen
{count} stemmen

5 antwoorden

Sorteren op: Meest nuttig
  1. Kimberly Olaño 20,620 Reputatiepunten Onafhankelijke adviseur
    2025-08-08T07:30:17.5366667+00:00

    Hi Mouaid, this is Kimberly. I'm glad to assist you today.

    It sounds like you've already taken a thorough approach to troubleshooting the Excel Solver Add-in Error 1004 and the "SolverCode" compilation error, but issue persisted.

    Since the error is about a compilation error in a hidden module, it likely involves VBA. Please try this:

    Press Windows + R, type:

    %programfiles%\Microsoft Office

    Navigate into your Office folder (Office16, Office15, etc., depending on your version).

    Find and run VBE7.DLL if present, this can register the VBA environment.

    Open Command Prompt as Administrator and run:

    regsvr32.exe VBE7.DLL

    This re-registers the VBA engine, which Solver relies on.

    If you need more from me apart from the solutions I provided, please let me know.

    Best regards,

    Kimberly

    0 opmerkingen Geen opmerkingen

  2. Mouaid Al Dahr 0 Reputatiepunten
    2025-08-08T08:00:58.7166667+00:00

    Hi @Kimberly Olaño ,

    It sadly didn't work.
    Yesterday i got an answer from you guys that i need to go back to the 32bit version and didn't work as well but now i can't find the file that you mentioned VBE7.DLL, neither in File explorer or with cmd (as administrator) Screenshot_6

    0 opmerkingen Geen opmerkingen

  3. Kimberly Olaño 20,620 Reputatiepunten Onafhankelijke adviseur
    2025-08-08T08:09:24.2433333+00:00

    Hi Mouaid,

    In Excel, open the VBA editor (Alt + F11).

    Go to Tools → References, locate "Visual Basic for Applications" or similar, hovering over it should show the actual path the reference uses. This can help you trace where the physical .dll resides

    Best regards,

    Kimberly

    0 opmerkingen Geen opmerkingen

  4. Mouaid Al Dahr 0 Reputatiepunten
    2025-08-08T09:10:12.46+00:00

    I found the file VBE7.DLL in "C:\Program Files (x86)\Microsoft Office\root\vfs\ProgramFilesCommonX86\Microsoft Shared\VBA\VBA7.1\VBE7.DLL"

    and i've tried the following commands:
    regsvr32 "C:\Program Files (x86)\Microsoft Office\root\vfs\ProgramFilesCommonX86\Microsoft Shared\VBA\VBA7.1\VBE7.DLL"
    C:\Windows\SysWOW64\regsvr32 "C:\Program Files (x86)\Microsoft Office\root\vfs\ProgramFilesCommonX86\Microsoft Shared\VBA\VBA7.1\VBE7.DLL"

    None of them worked: i get an error from cmd saying The module "C:\Program Files (x86)\Microsoft Office\root\vfs\ProgramFilesCommonX86\Microsoft Shared\VBA\VBA7.1\VBE7.DLL" failed to load. Make sure the binary is stored at the specified path or debug it to check for problems with the binary or dependent .DLL files. The specified module could not be found.

    i also had to search through powershell to find the file VBE7.DLL
    and there was only one and that is the location that i mentioned above

    0 opmerkingen Geen opmerkingen

  5. Mouaid Al Dahr 0 Reputatiepunten
    2025-08-11T11:45:55.44+00:00

    Hi, haven't heard back from you :(

    0 opmerkingen Geen opmerkingen

Je antwoord

Antwoorden kunnen worden gemarkeerd als 'Geaccepteerd' door de auteur van de vraag en 'Aanbevolen' door moderators, zodat gebruikers het antwoord van de auteur kunnen weten.