How to Fix Run Time Error 91 on windows 10 and 11

Share

Getting run time error 91 when opening Excel? or showing dcomcnfg.exe runtime error 91 while executing an application or open file explorer on Windows 10? This error usually occurs when a program attempts to access an object variable that hasn’t been initialized or set to a valid value. Here in this post, we discuss What is Run time error? Why getting dcomcnfg.exe runtime error 91, Explore possible solutions to fix this Error on Windows 10. 

What is Run time Error?

A runtime error is a common error on Windows-based systems, caused by the programs which try and use the DCOMCnfg.exe file on your system. DCOMCnfg.exe is the most important program that is used to control various file permission on your system. Also, this helps to load up various programs on your computer. If this DCOMCnfg.exe get corrupted windows will display error message Runtime Error 91 frequently.

- Advertisement -

The error message will be like

Run time Error ’91’ :

Object variable or with block variable not set.

This error can occur in various programming languages such as Visual Basic for Applications (VBA) in Microsoft Office applications (e.g., Excel, Word, Access), Visual Basic (VB), and other languages that use object-oriented programming concepts.

Why Getting Runtime Error?

Normally this Runtime error 91 occurs when the DCOMCnfg.exe file gets damaged, corrupted or unable to be processed as reliably as possible.

Missing DLL, Invalid or incorrect object references, Missing object library references, Corrupted or outdated software, Compatibility issues or Malware or virus infections are common reasons cause Runtime error 91 on Windows 10.

Fix Runtime Error 91 on Windows 10

You may find software updates that solve your runtime error as well as additional updates that you were otherwise unaware of. By keeping your computer updated with the latest software and hardware patches, you can solve current problems as well as prevent future ones.

The first thing to do is report the issue to the developer who may not be aware of it.

Next, you can turn off script debugging so that you don’t have to see this message every time the software encounters it. After all, the message is for the developer, not the end user.

Disable Script Debugging

Script debugging is made possible by a service called Machine Debug Manager. The easiest way to control it is through Internet Explorer.

  • Type Internet Options on Start menu search and click the first option.
  • Here on internet options move to Advanced Tab.
  • Now scroll down to Browsing and checkmark on Disable Script Debugging (Internet Explorer) and Disable Script Debugging (Other).
  • Runtime error 91 falls into the broad category of program errors that require updates from the developer.

disable script debugging on internet options

Change DCOMCnfg.exe Settings

The main cause of this error is thanks to the way that “DCOMCnfg.exe” blocks permissions on certain files and programs. DCOMCnfg.exe is a program used to help your computer control various aspects of the system. From making it load its programs to helping you control file permissions. It’s often the case that DCOMCnfg.exe will block public access to certain files And That creates the Runtime 91 error as a result.

You should load up DCOMCnfg.exe on your PC and change the permissions so that it grants access to “Everyone”.

Run the Program as an Administrator

Certain programs require administrative privileges to function correctly. If Runtime Error 91 persists, try running the program as an administrator.

  • Right-click on the program’s executable file or shortcut icon.
  • Select “Run as administrator” from the context menu.
  • Check if the error still occurs.

Reinstall the Problematic Program

If the Runtime Error 91 occurs consistently when running a particular program, it is possible that the installation files have become corrupt.

First, uninstall the program from your system.

  • Press the Windows key + X on your keyboard and select “Apps and Features” from the menu.
  • Locate the problematic program in the list, click on it, and then select “Uninstall.”
  • Once uninstalled, visit the official website of the program and download the latest version.
  • Install the program again following the provided instructions.

Update Windows and Installed Programs

Outdated operating systems and software can often lead to compatibility issues and runtime errors. You must check and install latest Windows updates As these updates are created specifically to fix issues like this. Check for updates of Windows OS and its Installed application software. Updating can work greatly, It fixes many bugs. So, You will have a good chance to get rid of Runtime Error 91.

  • Go to “Settings” by clicking on the Start button and then the gear icon.
  • In the Settings window, select “Update & Security.”
  • Click on “Check for updates” to search for and install any available updates.

Download Windows 10 update

Additionally, update any programs that you suspect may be causing the error by visiting their official websites and downloading the latest versions.

Clean Out Viruses

Viruses and malware infections are another big cause of the Runtime 91 error. And in order to prevent them from being such a big issue for your system We recommend performing a full system scan. Ensure that your antivirus software is up to date with the latest virus definitions.

Antivirus scan

Clean The Registry

The ‘registry’ is a central database for Windows that stores all the settings and options that your computer requires to run. As you use all the software on your PC, the registry is being read 100’s of times to help it recall various settings and information that your computer needs to run, and this can cause a big problem.

The issue is that since the registry contains so many files and settings that Windows requires to run Most of the time, this database is continually becoming damaged and corrupted. This is a big problem because if it cannot read the settings it needs, it can cause the Runtime 91 error.

To fix this problem, it’s highly recommended you use a registry cleaner, like Ccleaner.

Ensure Object Libraries are Referenced

Sometimes, missing or incorrect object library references can trigger Runtime Error 91.

  • Open the Visual Basic Editor by pressing “Alt+F11” in the program where the error occurs.
  • Click on “Tools” and select “References” from the dropdown menu.
  • In the References dialog box, check if any references are marked as “Missing.” If so, uncheck them and search for the correct reference.
  • Locate the correct reference in the list and check the corresponding box. Click “OK” to save the changes.

Perform a System File Check

Corrupted system files can cause various errors, including Runtime Error 91. Windows 10 includes a built-in tool called System File Checker (SFC) that scans and repairs system files.

To run SFC, follow these steps:

  • Press Windows key + S, type cmd and select run as administrator
  • In the command prompt window type “sfc /scannow” without quotes and press Enter.
  • Wait for the scan to complete and follow any on-screen instructions if prompted.

Also Read

Steve Ballmer
Steve Ballmer
With over 7 years of experience in the IT industry, I have experience in IT support, helpdesk, sysadmin, network admin, and cloud computing. Certified in Microsoft Technologies (MCTS and MCSA) and also Cisco Certified Professional in Routing and Switching.

Popular posts

NordVPN Birthday Deal

2-Year plan: 67% off + 3 Months FREE

30-day money-back guarantee