Troubleshooting VBA Object Variable or With Block Variable Not Set Error

VBA Object Variable or With Block Variable Not Set
VBA Object Variable or With Block Variable Not Set

All Windows-based operating systems are capable of experiencing the runtime error “Object variable or with block variable not set.” The DCOMCnfg.exe file, which is frequently used to establish rights and set system-wide security settings, is generally the major offender in this rather typical problem.

Runtime Error 91 appears on the screen when this file is corrupted or when other problems occur, preventing the software from functioning as intended.

Object variable not set error message

In this post, we’ll look at some of the fixes that could be able to help you repair Runtime Error 91. However, there may be other causes for the problem to occur.

The Runtime Problem 91 can appear in a number of various circumstances, including during the setup of a program, during startup, or during the shutdown. However, some users may also get the error after upgrading their Windows to a newer version.

The steps required to resolve Error 91 on the system are also based on when the problem was first noticed. After a program has been installed, a link to the downloaded software may have malfunctioned, which is the cause of Runtime Error 91. This link’s absence or brokenness usually results in Runtime Error 91.

Troubleshooting “VBA Object Variable or With Block Variable Not Set” Error

Make sure that everyone is permitted to launch DCOMCnfg.exe.

  1. Type DCOMCnfg.exe into the Windows search menu and hit Enter.
  2. Navigate to My Computer: Component Services > Computers > My Computer.”
  3. Select Properties from the context menu when you right-click on My Computer.

My computer properties

  1. Under Access Permissions, choose Edit Limits from the COM Security tab.
  2. Select Everyone and confirm that Local and Remote Access are both set to Allow.

My computer properties access permission

Virus-check your computer

Malware is capable of causing a wide range of issues with your computer in addition to corrupting several files that are either system- or program-related. Therefore, malware may be a contributing factor to your experience with Runtime Error 91.

You should check your computer with reliable anti-malware software to make sure that this is not the case. You may select a third-party anti-malware program based on your needs among the many premium and free options that are offered online.

To be sure there are no dangerous files present, you can also use Windows Defender (formerly called Microsoft Defender) to do a complete system scan.

  1. Double-click the Windows Security icon after selecting the system tray arrow.

Window security icon

  1. Choose threat and virus protection.
  2. Under the Quick Scan button, select Scan options.
  3. Click Scan Now after selecting the Full scan option.

Window security full scan

Uninstall the troublesome software and install it again.

File corruption may be the root of variable problems. Users might do an SFC scan using the built-in tool to repair the damaged data in the system files.

Even though it is one of the primary applications that operate on the PC, this procedure will not function if the damaged files are not those of Windows but rather those of an external application. Therefore, you ought to attempt reinstalling the malfunctioning application that results in Runtime Error 91.

  1. Open the Run program by typing run into the Windows search box.
  2. Type appwiz.cpl and press Enter in the Run box.

Open appwiz cpl

  1. Locate the problematic programs in the Programs and Features box that has been displayed.
  2. Select Uninstall from the menu by performing a right-click on it.

Uninstall autodesk single sign on app

  1. If necessary, restart the computer and download the same application once more.
  2. Reinstall the application after that to see if it helps to resolve Runtime Error 91.

Update Windows

Updates for the.NET Framework and Visual Basic are applied via Windows upgrades, and these updates may be connected to the Runtime Error 91. As a result, verify that Windows is updated.

  1. Select Settings from the context menu when you right-click the Start button.

Start button settings

  1. Choose Update & Security.
  2. Click “Check for Updates” to check for any updates.