I recently reinstalled Windows 10, Avira Free Antivirus v. 184.108.40.206, and Office Professional Plus 2010. Before the reinstallation, this combination of applications worked fine.
Now, when I try to open the VBA IDE from a new Word document, I get the following message:
Word has encountered a problem.
There is a problem saving the file.
with some possible causes listed underneath, such as missing disk space, low RAM, or missing permissions; none of which are relevant.
The only thing that might be relevant is:
This error can also occur if the computer is running a version of antivirus software that is incompatible with the Microsoft Office or must be updated.
As noted, I am running Avira Free Antivirus, and AFAICT the antivirus is updated. I tried opening the VBA IDE while Avira real-time protection was turned off, but without success.
Once I dismiss the message, the VBA IDE window opens, but there is no available project, and most of the menu items are disabled.
Saving a document with the
.docm extension before opening the VBA IDE doesn't help.
There are comparable odd results when trying to open the VBA IDE from other applications:
- Excel lists three projects Project1, Project2 and Project3, but without the usual tree of objects underneath each project -- class modules, standard modules etc -- and without the ThisWorkbook node.
- PowerPoint does the same as Word -- no project at all -- but without any error.
I've tried uninstalling and reinstalling VBA via the Office installer.
Security settings are set to disable macros with a warning. IIRC the old behavior was to disable macros unless I explicitly allowed them for the specific document. Trust the object model for each application is checked.
I've looked for a setting to control this in Avira, with no success.
The registry doesn't contain the
VBAOff key described here.
How can I enable VBA for the Office applications?
NB. The previous installation wasn't a clean install of Windows 10; it was first Windows 8, then 8.1, then 10.
Things I have tried before opening the VBA editor:
- Repair Office
- Uninstall and reinstall Office, then manually install Office 2010 SP2
- Windows update (only found Office updates after the aforemnetioned manual installation)
- Running Word with administrator permissions
- Enable all macros selected from the Trust Center
- Deleting the
Normal.dotmtemplate and allowing Word to recreate it
- Uninstalling Office, running the "Clean Office uninstall" tool referenced by @harrymc in the comments, and reinstalling Office
- Adding Outlook (which was previously not installed)
- Turning off UAC (before starting Word)
- Booting in Safe Mode -- I was unable to start Word; Word wasn't recognized as activated
HKLM\SYSTEM\CurrentControlSet\Control\FileSystem LongPathsEnabled = 1, and rebooting
Looking at the Event Viewer, I didn't find anything in System, Application or Security (all under Windows Logs). The only thing I did find was the following event in Applications and Services Logs -> Microsoft Office Alerts every time I try to open the VBA editor in Word on a new document:
Log Name: OAlerts Source: Microsoft Office 14 Alerts Date: 07/03/2019 20:49:42 Event ID: 300 Task Category: None Level: Information Keywords: Classic User: N/A Description: Microsoft Word Word has encountered a problem. P1: 200815 P2: 14.0.7015.1000 P3: 5v59 P4: 0x80070002 Event Xml: <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event"> <System> <Provider Name="Microsoft Office 14 Alerts" /> <EventID Qualifiers="0">300</EventID> <Level>4</Level> <Task>0</Task> <Keywords>0x80000000000000</Keywords> <TimeCreated SystemTime="2019-03-07T18:49:42.772417400Z" /> <EventRecordID>120</EventRecordID> <Channel>OAlerts</Channel> <Security /> </System> <EventData> <Data>Microsoft Word</Data> <Data>Word has encountered a problem.</Data> <Data>200815</Data> <Data>14.0.7015.1000</Data> <Data>5v59</Data> <Data>0x80070002</Data> </EventData> </Event>
There is no similar event when opening the editor in Excel or PowerPoint.
Using Sysinternals ProcMon, capturing only while trying to open the VBA editor from Word, and filtering the results for
Process Name = "WINWORD.EXE" and excluding
BUFFER OVERFLOW and
NAME NOT FOUND from
Result, I found the following:
RegOpenKey ACCESS DENIED HKLM\Software\WOW6432Node\Microsoft\VBA CreateFileMapping FILE LOCKED WITH READERS C:\Program Files (x86)\Common Files\microsoft shared\VBA\VBA7\VBE7.DLL CreateFileMapping FILE LOCKED WITH READERS C:\Program Files (x86)\Common Files\microsoft shared\VBA\VBA6\VBE6EXT.OLB
FILE LOCKED WITH READERS repeats a number of times.
But on further investigation, I see that later reads from the same registry key (
HKLM\Software\WOW6432Node\Microsoft\VBA) succeed. Also, the
CreateFileMapping is using the long name of the path; which is immediately followed by a successful
CreateFileMapping using the DOS name, e.g.