'Word VBA getting Project is Unviewable error
When I try to edit or step into my VBA code for debugging purpose I get "Project is Unviewable". I have created .dotm file at location (C:\Users\UserName\AppData\Roaming\Microsoft\Word\STARTUP).
Solution 1:[1]
When launched automatically at startup the VBA project in .DOTM files are not viewable. I couldn't find this clearly documented by Microsoft but I tested/replicated it across multiple OS and versions of Office to conclude it was "by design"
There is some ways around it:
Option #1
Copy template OUT of Start Up Folder, right click file and select "Open" You can debug it.
Option #2
Ensure you have write permission to file in startup folder. Even if you are Admin, if UAC is ON you won't have access - grant your user "full control" or "write access to file" to DOTM file in startup folder.
Close all instances of Word, right click .DOTM file and Open, you can now debug it.
However you can't save changes - to save changes you must grant permissions for the user to write to the STARTUP folder.
Solution 2:[2]
this is not a bug. This is a feature of Microsoft Templates when you open a template it never opens original file rather opens a copy of the template. to modify or debug a template right click on template itself and say open or open word and use Open file dialog to modify the code of the template.
Solution 3:[3]
Update 2022
When editing macro-enabled Word documents (for example, .docm files) that are stored on OneDrive, you may receive the following warning:
SECURITY WARNING
Macros have been disabled.
Enabled Content
After clicking Enabled Content, and opening the VBA editor, attempting to view the project may result in the error:
Project is unviewable
After closing and reopening the document, again open the VBA editor. Within the Word document, you will then receive the following message:
EDITING MACROS
Check out this document to view and edit its macros.
Check Out
After checking out out the document, macros may be edited.
Solution 4:[4]
Open the .dotm from .../STARTUP location and do modifications and saves there.
Solution 5:[5]
Open your DOTM file and on Developer Tab (you will need to enable Dev Tab first 1) and choose Document Template and uncheck items that are currently loaded in under Global templates and add-ins.
Solution 6:[6]
To expand on https://stackoverflow.com/a/39171282/5025060, in my case (Windows 7 Pro, MS Word 2007), left-clicking on a .dot file from Windows File Explorer (Win+E) causes MS Word to create a new document (namedDocument5in my case). The macros from the .dot file I opened are active inDocument5, but when I attempt to edit these macros (MS Word Developer tab, Macros button, Edit button) this message pops up:
However, if I right-click on the .dot file from Windows File Explorer, select Open With, and choose Microsoft Office Word from File Explorer's menu, MS Word opens the file for editing rather than creating a new Document (the name in Word's Title Bar is that of the .dot file I opened). From this instance of Word I can view and edit the macros contained in the .dot file.
Solution 7:[7]
Go to Review > share workbook > Editing > disable the checkbox
Solution 8:[8]
For anyone having this issue that uses Office 365 with OneDrive, please note that if your docm document was previously synced to your OneDrive, but your OneDrive is currently logged out, this will cause the "Project is unviewable" error. If you log back into OneDrive and sync the docm file, you should be able to edit the VBA as normal. In my case, this fixed the issue.
Solution 9:[9]
For editing VBA you have to go to Review/Share workbook. Need to disable checkbox.
Good luck =)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Malcolm McCaffery |
| Solution 2 | Rashid Khan |
| Solution 3 | |
| Solution 4 | nicname |
| Solution 5 | iaforek |
| Solution 6 | Community |
| Solution 7 | Lakhan Mane |
| Solution 8 | Trayton |
| Solution 9 | andexte |

