"Excel VBA not found" usually means one of three things: the Developer tab and Visual Basic Editor are simply switched off in your Options, a macro-enabled workbook or add-in lost its VBA project, or Excel is blocking macros from a file it considers untrusted. The shortest fix is to turn on Trust Center macro settings and the Developer tab, then open the editor with Alt+F11. If a specific file still reports a missing VBA project, open it with macros enabled and repair or re-import the modules.
What You'll Need
- Excel for Windows or Mac (the desktop app, not Excel on the web, which has no VBA editor).
- Administrator access to your machine if your organization manages Excel settings centrally.
- The workbook in .xlsm, .xlsb, or .xlam format, since standard .xlsx files cannot store macros.
- A few minutes to check Trust Center settings and, if needed, re-import code from a backup.
Step-by-Step
- Confirm you are in the desktop app. Excel for the web and the mobile apps cannot run or show VBA. Download the file and open it in the Windows or Mac desktop version. If you only ever see the online copy, that alone explains the message.
- Turn on the Developer tab. Go to File > Options > Customize Ribbon, tick Developer in the right-hand list, and click OK. On Mac, use Excel > Preferences > Ribbon & Toolbar. Menu labels can differ slightly by version, device, and region, but this path has been stable for years.
- Open the Visual Basic Editor. Press Alt+F11 on Windows, or Option+F11 on Mac, or click Developer > Visual Basic. If the editor opens but your project is missing from the Project Explorer (View > Project Explorer), skip to step 6.
- Check macro security. Go to File > Options > Trust Center > Trust Center Settings > Macro Settings and choose Disable all macros with notification. That setting still gives you the yellow warning bar so you can enable macros per file deliberately. Avoid "Enable all macros" as a permanent setting; it removes your main protection against malicious files.
- Enable content in the file itself. Reopen the workbook and look for the yellow security bar under the ribbon. Click Enable Content. If the bar never appears, the file may be sitting in a location Excel treats as untrusted, or it may be marked as blocked. Right-click the file in File Explorer, open Properties, and if you see an Unblock checkbox at the bottom, tick it and click OK. On Mac, check System Settings > Privacy & Security for any notice about the downloaded file.
- Look for a missing VBA project reference. In the editor, click Tools > References. Any entry prefixed with MISSING: is a library your code expects but Excel cannot find, often because a different Office version or add-in installed it. Note the name, untick it only if you know the code does not use it, or reinstall the component that supplies it, then click OK.
- Check for disabled add-ins or a stuck startup. Close Excel. Reopen it while holding Ctrl (Windows) to start in safe mode. If the VBA editor works there, an add-in is the culprit. Go to File > Options > Add-ins, set the manage dropdown to Excel Add-ins, click Go, and clear the boxes of third-party add-ins one at a time until you find the offender.
- Confirm the file actually contains code. Rename a copy of the workbook to add a .zip extension and open it, or simply look inside the VBA editor for the file's project. A workbook that was saved as .xlsx after editing will have silently discarded every module. If the project is gone, restore the previous .xlsm or .xlsb version from version history or your backup.
- Re-import the code if needed. Open the editor, use File > Import File to bring in a saved .bas, .frm, or .cls export, or paste module text from your backup into a new module inserted with Insert > Module. Save as .xlsm and test a simple macro before relying on the file.
Common Mistakes
The most frequent one is saving as .xlsx after adding code. Excel warns you that macro-free formats drop the VBA, and clicking through that prompt deletes the project permanently unless you have a backup. Always save as .xlsm, .xlsb, or .xlam.
Second is looking for VBA in Excel for the web or a phone app. Neither supports it, so "not found" is expected there, not a fault.
Third is enabling all macros everywhere out of frustration. That permanently disables a real security layer; enable content per file instead. Fourth is unticking every MISSING reference in Tools > References without understanding which one broke, which replaces one error with another later. Fifth is editing a file stored on a network share or synced cloud folder that is read-only or partially downloaded, which can make projects appear empty or fail to open.
Tips
- Keep one known-good .xlsm copy of any workbook you rely on, and export modules regularly via File > Export File in the editor.
- Add your trusted folders to Trust Center > Trusted Locations so daily files open without the security bar, while everything else stays protected.
- Press Alt+F11 early when a file misbehaves. If the editor opens with the project listed, the problem is permissions or references, not a missing project.
- Use Disable all macros with notification as your default. It is the balance point between usability and safety.
- If your organization pushes settings, changes you make locally may be overwritten at the next policy refresh. Ask IT before troubleshooting deeply.
Troubleshooting
The VBA editor will not open at all. Try safe mode (Ctrl while launching Excel). If it opens there, disable add-ins. If it still fails, repair Office through Settings > Apps > Microsoft 365 > Modify > Quick Repair, then Online Repair. Repairing does not delete your workbooks, but close them first.
You get "Programmatic access to Visual Basic Project is not trusted." Go to File > Options > Trust Center > Trust Center Settings > Macro Settings and tick Trust access to the VBA project object model. This is required by some tools that read or write code; leave it off if nothing needs it.
A workbook opens with no modules and no error. The project was likely lost when the file was saved in a macro-free format or created by a tool that stripped it. Restore from version history, backup, or an exported module.
Macros run for others but not you. Compare Trust Center settings and check whether a Group Policy or managed preference is enforcing a stricter level. On Mac, check whether the file came from the internet and is quarantined.
Nothing changes after edits. Confirm you are editing the right project. Duplicate file names and network copies are a common source of confusion; check the path shown in the editor's title bar.
Frequently Asked Questions
Why does Excel say VBA is not found when the file is .xlsm?
Either macros are disabled by Trust Center or policy, the file is blocked because it came from another computer, or its VBA project was damaged. Enable content, unblock the file, then check Tools > References.
Can I use VBA in Excel for the web or on a phone?
No. VBA only runs in the desktop versions of Excel. You can open and view a macro-enabled workbook in the browser, but the code will not execute there.
Does repairing Office delete my macros?
No. Repair reinstalls program files, not your documents. Your .xlsm workbooks and their modules stay in place.
What is a MISSING reference in the VBA editor?
It is a code library the workbook expects but Excel cannot load, usually because a different Office version or add-in installed it differently. Restore the component or, if the code does not use it, untick it.
Is it safe to turn on all macros?
Not as a permanent setting. Use "Disable all macros with notification" and enable content file by file, so a malicious attachment cannot run unchecked.
Will my macros survive saving to OneDrive?
Yes, if the file stays .xlsm or .xlsb. Syncing does not strip code, but concurrent edits by others can conflict, so keep a local backup copy.