The error “Project is Unviewable” (often appearing simply as a modal message stating “Project Locked: Project is unviewable”) occurs when you attempt to expand or inspect a VBA project inside the Visual Basic Editor (VBE), but Excel actively blocks access to the code tree.
Quick Answer
This issue almost always occurs because the workbook was saved using Excel’s Legacy Shared Workbook feature or is marked as an embedded sub-object inside another document. To unlock the project, open the workbook in Excel, navigate to the Review tab, click Share Workbook (Legacy), uncheck “Use the old shared workbooks feature instead of the new co-authoring experience”, click OK, and save the file.
What Causes a VBA Project to Become Unviewable?
Unlike a standard password-protected VBA project—which displays a password prompt when clicked—an unviewable project presents an outright refusal dialog:
┌───────────────────────────────────────────────┐
│ Microsoft Visual Basic for Applications │
├───────────────────────────────────────────────┤
│ │
│ Project is unviewable │
│ │
│ [ OK ] [ Help ] │
└───────────────────────────────────────────────┘
This state indicates that Excel’s runtime environment has placed the VBA storage container into a locked structural state. The four primary causes are:
- Legacy Workbook Sharing is turned on: Excel explicitly disables VBA editing in legacy shared workbooks to prevent structural sync conflicts.
- The file is embedded in another OLE container: Opening an Excel spreadsheet embedded inside Microsoft Word, PowerPoint, or an Internet browser locks the VBE container.
- The file is open in a restricted Protected View or Excel Online session: Workbooks hosted directly in cloud co-authoring environments lack native desktop VBE access.
- Binary corruption in the
vbaProject.binstream: A damaged compiled module header prevents the IDE from parsing the code layout.
Diagnostic Tree: Determining the Root Cause
Follow this diagnostic path to determine why the project is locked:
"Project is Unviewable" Appears in VBE
│
▼
Does the title bar say "[Shared]"?
│ │
YES NO
│ │
▼ ▼
Disable Legacy Is the workbook embedded
Workbook Sharing inside another document?
│ │
YES NO
│ │
▼ ▼
Extract file Inspect workbook
to desktop for digital lock
and re-open or binary corruption
Step 1: Remove Legacy Shared Workbook Protection
The most common cause of this error is the legacy sharing mechanism. When legacy sharing is active, the workbook title bar displays [Shared] alongside the file name.
- Switch back from the VBA Editor to the main Excel interface.
- Go to the Review tab on the Ribbon.
- Look for the Share Workbook (Legacy) button.
(Note: If this button is missing, open File > Options > Quick Access Toolbar, select All Commands, and add Share Workbook (Legacy) to your toolbar). - In the dialog, open the Editing tab.
- Uncheck the box labeled “Use the old shared workbooks feature instead of the new co-authoring experience”.
- Click OK. A warning prompt will confirm that this action removes the workbook from shared use. Click Yes.
- Save the workbook (
Ctrl + S), close Excel completely, and reopen the file. - Press
Alt + F11. Click the project node in the Project Explorer; the password prompt or code modules will now open normally.
For an in-depth breakdown of legacy sharing conflicts, consult VBA Project Locked: Fixing “Project is unviewable” in Shared Workbooks. and Handling “Someone else has this file open” when using Legacy Shared Workbooks..
Step 2: Extract Embedded Workbook Objects
If an Excel workbook is embedded as an OLE object inside a Microsoft Word document or PowerPoint presentation, double-clicking it opens an in-place editing session. If you press Alt + F11 from this session, the project displays the “Project is unviewable” error. The host application locks child VBA storage streams to prevent modifications that could break the host file.
The Fix
- Right-click the embedded Excel spreadsheet inside the host application (Word or PowerPoint).
- Choose Worksheet Object > Open (rather than Edit).
- In the new standalone Excel window, click File > Save As.
- Save the file to your local drive as a standard Excel Macro-Enabled Workbook (
.xlsm). - Close both programs, then open the freshly saved
.xlsmfile directly in Excel.
Step 3: Check for Protected View and Multi-User Cloud Sessions
Files opened directly from email attachments, untrusted intranet portals, or cloud synchronization directories often load in Protected View. While Protected View prevents macros from executing, it also locks the underlying VBA project structure.
- Look for a yellow bar at the top of the worksheet reading “Protected View: Be careful—files from the Internet can contain viruses.”
- Click Enable Editing. Once the workbook switches to a standard desktop editing state, press
Alt + F11to access the project.
If you are working on a file hosted on OneDrive or SharePoint with AutoSave enabled, real-time co-authoring may block structural changes to the VBA container. Save a local copy by selecting File > Save a Copy, store it in a local directory, and inspect the project in that offline instance.
Step 4: Repair a Corrupted vbaProject.bin Stream
If the workbook is not shared, not embedded, and not running in Protected View, the VBA storage stream itself may be corrupt. Excel protects itself from crashing by refusing to render an unparseable project tree.
You can inspect and recover the underlying components using archive extraction:
- Close Excel and create a backup copy of your
.xlsmfile. - Change the file extension of the copy from
.xlsmto.zip. - Open the
.ziparchive using Windows Explorer or an archive tool (such as 7-Zip). - Navigate into the
xlfolder. - Check whether the
vbaProject.binfile exists:- If
vbaProject.binis completely missing, the VBA project was stripped out during a previous save (often caused by saving an.xlsmas a standard.xlsx). The code cannot be recovered without an earlier backup. - If
vbaProject.binis present, the internal header may be damaged.
- If
Workbook.xlsm (Rename to .zip)
│
├── [Content_Types].xml
├── _rels/
└── xl/
├── workbook.xml
├── worksheets/
└── vbaProject.bin <-- Core binary code stream
To recover damaged structures without third-party software, review How to recover a “Corrupt” Excel file using the XML extraction method.. If the file displays unreadable content errors during the recovery process, follow Fixing “Excel found unreadable content” in .xlsm files. to restore module integrity.