What is 'VBA runtime error 91'?
VBA runtime error 91 is an error that usually occurs when attempting to use an application that has issues with the variables within it. Basically, a variable is a container that programmers use to store flexible data. The error may refer to the wrong kind of data stored in a variable or the variable itself is being referenced incorrectly.
Tools used in the development of applications including DCOMCnfg.exe, .NET Framework and Visual Studio have been known to be related to the error.
Other causes for the error may also include malicious files, viruses, and the incomplete installation of a Windows operating system.
How can you fix 'VBA runtime error 91'?
Some of the common fixes include:
- Configuring DCOMCnfg.exe
- Doing a Windows Update
- Installing Microsoft Visual C++Redistributable and .NET Framework
- Reinstalling the software or application
Please see our in-depth walk-through solutions below.
1. Configure DCOMCnfg.exe
Distributed COM might be disabled resulting in "VBA runtime error 91." Enable it to fix the error. See instructions below.
Also, the account you are using might have no permission to do any changes related to Distributed COM. Please log as administrator.
Enable Distributed COM
- Open Component Services, click Windows Start then type "DCOMCNFG" and press Enter key.
- Expand Component Services >> Computers >> My Computer.
- Right-click My Computer and select Properties.
- Click Default Properties Tab, and Enable Distributed COM on this computer then press OK.
- Optional: To give access to another account, click COM Security tab.
- Click Edit Limits, click Everyone or whoever you want to have access to it then check the Allow access and click OK.
- Click Edit Default then check the Allow access to both SELF and SYSTEM and then click OK.
- Restart your Computer.
Also, some of the DLL might not be registered. See below to register DLLs.
- Press Windows key + S key or click Windows Start.
- Type "DCOMCNFG" and press Enter key.
- Expand Component Services >> Computer >> My Computer.
- Then click DCOM Config, if a confirmation appears to register components, click Yes.
Please confirm it all. - Restart your Computer.
2. Do a Windows Update
"VBA runtime error 91" may also occur when your Windows is not updated. Sometimes, the software requires a specific Windows file from a Windows Update to be able to run. An example is the latest version of Microsoft Visual C++ Redistributable and .Net Framework. See instruction here on YouTube.
Restart your PC and do a Windows Update.
For Windows 7
Go to Control Panel ==> System and Security ==> Windows Update ==>Install Updates.
Windows 10
Click Windows Start, type Check for updates and press Enter key.
3. Installing Microsoft Visual C++ Redistributable and .Net Framework
"VBA runtime error 91" could also be due to a missing, corrupt or out of date Microsoft Visual C++ Redistributable and .Net Framework. Try to download the lasted version of the Microsoft Visual C++ Redistributable and .Net Framework. Microsoft Visual C++ Redistributable and .Net Framework will also provide you the DLL you may need to fix the error. See instruction below or watch it here on YouTube.
4. Reinstall the Software or Application
Incomplete installation of a software or application may also result in “VBA runtime error 91.” The reinstallation of the software may also result in the error due to remnant files, DLL and the registry of the previously installed software. To fix this, uninstall the software and run cleaner to delete remnants and temporary files. See the guide below.
Run Disk Clean Up
Watch it here on YouTube
- Click Windows start then type in “Disk Cleanup” and then press Enter key.
- Click all checkbox, click Ok button and press Ok for the confirmation.
- This will clean all temporary file.
Run CCleaner
NOTE: Download it here.
- Run CCleaner.
- Click Registry.
- Check all checkbox.
- Click Scan for Issues. Wait until it is finished.
- Click Fix selected issues. Wait until it is finished.
- Restart your computer.
- Then, install the software or application again.