How to Troubleshoot Runtime Error 91 on Windows PC

Have you encountered the Microsoft Visual Basic error “Runtime error ’91’: Object variable or With block variable not set” when you open a SOLIDWORKS file? Or when you create a new SOLIDWORKS macro and see that message appear when you run it?

Fortunately for you, this is a very common VB error, and it’s not very difficult to determine where the problem lies.

What causes runtime errors 91?

The reason why the pop-up window with the message “Runtime Error 91: Object variable or with block variable not set” appears is because the DCOMCnfg.exe file may be corrupted. The DCOMCnfg.exe file is commonly used to configure permissions and set security settings on a system. If there is a problem with this file, your system will not be able to load the files needed to start up, and a runtime error 91 will be displayed. read more