Are you finding it difficult to work on Excel or Word because of an error? The runtime error 91 is an error that originates in Microsoft Office and makes it impossible to use it, let alone open it. And if you regularly use Office for your job or university work, the situation becomes difficult, especially since the error is pretty cryptic. So, what causes the word and excel runtime error 91? Is there a way out of it? Do you have to go through the installation process again or make a new account? Read on to discover all the answers.
What Is the “Runtime Error”?
The runtime error is an error that is produced on Windows-backed systems, more specifically on programs that use the DCOMCnfg.exe files. The files are responsible for regulating file permission for your system. Besides that, it also helps launch apps and programs for use. In case this file gets damaged or corrupted, you’ll face runtime error 91 excel VBA or its other variants.
What Causes the “Runtime Error 91” Error?
Like every other runtime error, the word or excel “runtime error 91: Object variable or with block variable not set” occurs because of a corrupted DCOMCnfg.exe file. Since the .exe file is tasked with giving permissions and opening files, the entire Microsoft Office stops and no programs under it, word, excel, or PowerPoint, open up.
How to Fix Runtime Error 91?
While the error is pretty annoying, its solutions are quite straightforward. Here’s how you can solve VBA runtime error 91:
Method 1 – Reinstall the Problematic Application
One can run the SFC scan to fix the problems within the system file and eliminate the issue. But what if the file corruption arises from a third-party application and not from default Windows apps? In such a case, even if it is a core app, the SFC scan won’t work.
The best solution is to uninstall and install the problematic app again. To do so:
- Open the Control Panel by pressing Win+R and typing control on the pop-up window that appears. You can also search it manually from the Start Menu.
- From the control panel, navigate to Programs and then Uninstall a program.
- A list of all the downloaded applications will appear. Select the one causing the problem, in this case Microsoft Office. Right-click on it and choose Uninstall.
- Once uninstalled, install the app and check if the problem persists.
Method 2 – Set Dcomcnfg.exe to Be Allowed to Run by “Everyone”
As discussed, Dcomcnfg.exe remains the biggest culprit behind the runtime error 91. Since the corruption causes the problem, you can change the file’s settings to get rid of it.
To make the suitable changes:
- On the Start menu’s search bar, type DCOMCnfg.exe to find and open the file.
- Once you open the file, a window titled Component Services will appear.
- From the menu, navigate to Computers – My Computer.
- Right-click on My Computer, and from the drop-down menu, select Properties. Another pop-up window appears.
- On the window, select the COM Security tab.
- At the top, you’ll see Access Permissions. Click the Edit Limits option under it.
- From the Edit Limits window, enter Everyone and ensure that Local and Remote Access have the boxes checked against Allow.
- Once you’ve checked the box, click OK on each window you’ve opened till now. The effect will take place immediately, and your access to excel and word should be restored.
Method 3 – Give Full Control to the Frxxmltag.xml File
If you’ve noticed that your system’s visual basic runtime error 91 is accompanied by Error 5999, then you should try giving complete control to the Frxxmltag.xml file. Here’s how:
- Launch Windows and operate it as an administrator.
- Open Windows Explorer and navigate to the FRx directory.
- Inside the directory, find FRxXMLTag.XML and right-click on it.
- Select Properties.
- From the properties window, go to Security and then Everyone.
- Under the Everyone group, choose Full Control.
- Press OK. The changes should be made, and the error is gone.
Method 4 – Disable Add-Ins to Fix Word Runtime Error
Undoubtedly, add-ins play an integral role in enhancing Word’s functionality and making it more user-friendly. They are always present as templates to make your work clearer and more manageable. However, sometimes these add-ins are corrupted and can stop Word from functioning correctly, showing visual basic runtime error 91.
Follow the steps below to disable these add-ins and bring back your Word:
- First, close all Word windows.
- Now, launch the Run utility by pressing Win+R together.
- 3.Type winword /safe in the box to open the Word application in safe mode.
- After it opens, navigate to File, Options, and then Add-ins.
- Choose COM Add-ins and tap on Go.
- You’ll discover a list of all add-ins on the COM Add-ins window. Uncheck them all to remove them and click on OK.
- Restart the application, and hopefully, it should work smoothly.
If the Word application works fine, then the problem must lie with one of the add-ins. Add them one by one and restart the application after each. This will help point out which exact add-in was causing the issue.
Method 5 – Repair Damaged Word Documents to Fix Error 91
If not the DCOMCnfg.exe file, it can be the corruption of a Word document causing the error. Accidents like partition failure, Operating system crash, random formatting, viruses, etc., can be the premise of Error 91.
Hence, if you also notice that Word file corruption is causing the problem, you’ll need to download a dedicated repair tool. Several reliable tools are available on the market, and you can take your pick. The best ones are:
- Wondershare Repairit
- Remo Word Repair
- S2 Recovery Tools
These tools are quite easy to use and have a high success rate. They’ll repair the corrupted files while still maintaining the original format.
Method 6 – Scan Your Machine for Malware
Malware like bugs and viruses can also be behind the problems occurring in your system. Besides just attacking the operating system, it also corrupts files attached to the applications. Thus, factoring in malware, the vb runtime error 91 can also be caused by viruses.
To check whether this is true, use a reliable anti-virus (or malware) software for a complete scan of your system. You can either use third-party software available on the market or go for Microsoft Defender. It’ll carry out a full system scan to rule out any possibility of malware presence.
To use it:
- On the bottom right, you’ll spot an upwards arrow called system tray. Open the tray and select the Windows Security icon.
- From the list of options, choose Virus and threat protection.
- On the right side panel, there will be a Scan options link below Quick Scan. Click on it, and a new window will appear.
- Tap on Full Scan and then Scan now.
- If it detects any malware, it’ll report the same back, and you can get rid of it manually.
Method 7 – Update Windows
The .NET Framework or Visual Basic runtime error 91 can be solved by updating Windows operating system. Since .NET Framework and Visual Basic’s updates are part of the OS update, you’ll only have to update once by:
- Go to the Start Menu and select Settings.
- Choose Update & Security and then Check for updates.
- If there are any pending updates, download and install them.
- Restart the computer.
And there you have it! We hope you found the answers you were looking for to fix runtime error 91. Microsoft is an essential part of our daily work routine; losing it for even a few hours is a nightmare. So, keep these solutions handy, in case you face this issue again!