VBA runtime error 91

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.

Sheila Staff Asked on September 21, 2017 in Microsoft Excel.
Add Comment
4 Solution(s)

Solution 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 

  1. Open Component Services, click Windows Start then type “DCOMCNFG” and press Enter key.
  2. Expand Component Services >> Computers >> My Computer.

    RE: Vba runtime error 91

  3. Right-click My Computer and select Properties.
  4. Click Default Properties Tab, and Enable Distributed COM on this computer then press OK.
  5. Optional: To give access to another account, click COM Security tab.
  6. Click Edit Limits, click Everyone or whoever you want to have access to it then check the Allow access and click OK.
  7. Click Edit Default then check the Allow access to both SELF and SYSTEM and then click OK.
  8. Restart your Computer.

Also, some of the DLL might not be registered. See below to register DLLs.

  1. Press Windows key + S key or click Windows Start.
  2. Type “DCOMCNFG” and press Enter key.
  3. Expand Component Services >> Computer >> My Computer.

    RE: Vba runtime error 91

  4. Then click DCOM Config, if a confirmation appears to register components, click Yes.
    Please confirm it all.
  5. Restart your Computer.
Gino Genesis Marasigan Staff Answered on March 22, 2018.
Add Comment

Solution 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.

RE: Vba runtime error 91

Windows 10

Click Windows Start, type Check for updates and press Enter key.

RE: Vba runtime error 91

Gino Genesis Marasigan Staff Answered on March 22, 2018.
Add Comment

Solution 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.

NOTE: A Windows Update might be required before you can install the latest version of the Microsoft Visual C++ Redistributable and .Net Framework

For Microsoft Visual C++ Redistributable.

Go here.

For Microsoft .Net Framework.

Go to here. 

Gino Genesis Marasigan Staff Answered on March 22, 2018.
Add Comment

Solution 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

  1. Click Windows start then type in “Disk Cleanup” and then press Enter key.

    RE: Vba runtime error 91

  2. Click all checkbox, click Ok button and press Ok for the confirmation.
  3. This will clean all temporary file. 

Run CCleaner

NOTE: Download it here.

  1. Run CCleaner. 

    RE: Vba runtime error 91

  2. Click Registry.
  3. Check all checkbox.
  4. Click Scan for Issues. Wait until it is finished.
  5. Click Fix selected issues. Wait until it is finished.
  6. Restart your computer.
  7. Then, install the software or application again.
Gino Genesis Marasigan Staff Answered on March 22, 2018.
Add Comment

Your Solution

By posting your solution, you agree to the privacy policy and terms of service.