Computer >> Computer tutorials >  >> Troubleshooting >> Windows Errors

How to Fix Runtime Error 91 on Windows?

Are you getting the Runtime Error 91 when trying to open a program? Is the DCOMCnfg.exe Runtime Error showing while launching the Excel program? Here’s good news for you. In this post, we will discuss everything about this error and share possible solutions to fix it.

What Is Runtime Error 91 on Windows?

The Runtime Error 91 is an error code that shows on all Windows operating systems. It’s a common error that is accompanied by the message, “Object variable or with block variable not set. The main culprit behind this issue is a faulty DCOMCnfg.exe file, but there could also be other triggers.

What Causes Runtime Error 91?

If you are asking, “Why Windows is getting Runtime Error 91?” Well, there are many possible causes.

Runtime Error 91 usually shows when you are trying to launch or use a program that has inconsistent codes or corrupt files. The likes of a virus infection, registry problems, and missing DLLs can also trigger it to show. But specifically, it’s a problem with the DCOMCnfg.exe file on your system. It’s preventing your system from loading the files that are required to run a program.

Pro Tip: Run a dedicated PC optimization tool to get rid of incorrect settings, junk files, harmful apps, and security threats that can cause system issues or slow performance.

Free Scan for PC Issues 3.145.873 downloads Compatible with: Windows 10/11, Windows 7, Windows 8

8 Ways to Resolve Runtime Error 91 on Windows

If you’re getting the Runtime Error 91 while trying to open a program on your Windows device, here are the solutions you may try:

Solution #1: Reinstall the faulty program

It is possible that you are getting the Runtime Error 91 due to file corruption. And to fix corrupted data within your system files, you may use the System File Checker utility to run a quick scan. Take note, though, that this method does not work if the corrupted files do not belong to any inbuilt Windows program.

If an external program or a third-party application is the one that has problematic or corrupted files, you may need to reinstall it. Here’s how:

  1. Into the Windows search field, input control panel and hit Enter.
  2. Next, go to Programs and select Uninstall a Program.
  3. From the list, right-click on the problematic app and select Uninstall.
  4. Once done, reinstall the application and check if the Runtime Error 91 still shows.

Solution #2: Install Windows Updates

If the problem is related to Visual Basic and the .NET Framework, then installing any Windows Updates may resolve it. So, make sure Windows is up to date by following these steps:

  1. Right-click on the Start button and go to Settings.
  2. Choose Update and Security.
  3. Click the Check for Updates button.
  4. Wait as Windows downloads and installs the updates.
  5. Once the update is completed, restart your PC to apply the changes.

Solution #3: Perform a thorough malware scan

Malware entities are known to cause all sorts of issues on the Windows platform. They can even corrupt all your files, regardless of whether they’re program files or part of your system files.

Now, if you suspect that malware is causing the Runtime Error 91, perform a malware scan. To do so, you will need to use a trusted anti-malware software program.

There are many paid and free antivirus solutions available online, but when making a choice, consider your needs. However, if you are not sure what to download, you may use the inbuilt Windows Defender to perform a complete system scan and ensure no malware entities hide in your system.

To perform a system scan using Windows Defender, do the following:

  1. Click on the Windows Security icon on the system tray.
  2. Choose Virus and threat protection.
  3. Select Scan options and click Full Scan.
  4. Hit the Scan Now button.

Solution #4: Change the settings of the DCOMCnfg.exe file

It is also possible that the Runtime Error 91 is caused by incorrect configurations of the DCOMCnfg.exe file. Here’s how to change its settings:

  1. Into the search bar, input DCOMCnfg.exe and hit Enter.
  2. In the Window that pops up, expand Component Services and go to Computers.
  3. Right-click on My Computer and select Properties.
  4. Navigate to Access Permissions and go to the COM Security tab.
  5. Select Edit Limits.
  6. Choose Everyone and be sure that the Remote and Local options are both set to Allow.

Solution #5: Grant full control to the FRxXMLTag.XML file

If the Runtime Error 91 is followed by the Error 5999, do the following:

  1. Run Windows as administrator.
  2. In the Windows Explorer, find the FRx directory.
  3. Right-click on the XML file and choose Properties.
  4. Go to the Security tab.
  5. Add Everyone as a group and choose Full Control.
  6. Hit OK.

Solution #6: Clean the registry

The registry is Windows’ database. It stores all the options, configurations, and settings that your computer needs to run. It’s more like a library of your PC. If you run a program, the registry is read a lot of times to recall all the information and settings that are required by the program to run. But since there are plenty of files that need to be checked, the registry becomes prone to becoming corrupted and damaged. When this happens, the Runtime Error 91 may surface.

To fix this issue, you may need to use a trusted registry cleaner. But make sure you download from reputable sources only.

Solution #7: Update your device drivers

It may be your motherboard or graphics driver that is interfering with the program and causing the Runtime Error. So, make sure your device drivers are all up to date. Download the most recent drivers for your device from the official manufacturer’s website or use a third-party device driver updater tool.

Solution #8: Reboot your PC

This may seem pretty basic, but this solution has worked for many Windows users. Restarting your system can resolve the common runtime errors like Runtime Error 91. Here’s how to give your PC a good reboot:

  1. Click on the Start menu and go to the Power icon.
  2. Select Restart.
  3. Once your PC has completely rebooted, check if the Runtime Error 91 still exists.

Summary

Runtime Error 91 may be common and can cause serious problems to Windows users. However, it can be fixed for good. You may reinstall the program where the error code shows or install any pending Windows update. If it doesn’t work, then change the settings of certain files. Now, if you think the problem is more serious than it looks, ask help from Windows professionals.

What other solutions do you know to resolve the Runtime Error 91? Share them with us below!