Skip to main content

SOLIDWORKS Macros Troubleshooting: Issues And Resolutions

SOLIDWORKS macro is the most common way to automate and extended the functionality of SOLIDWORKS via its API. Macros can be developed in-house or downloaded from the different web-sites including SOLIDWORKS forum, 3D Content Central, CodeStack etc. or even recorded from SOLIDWORKS.

But in some cases the macro doesn't work as expected. This is usually one of the following scenarios:

  • Macro which used to work correctly before stopped working.
  • Macro works on some of the workstations but not on the others.
  • Macro works correctly for some models but not the others.

In this article I will go through the most common symptoms of the errors in the macros.

Browse the errors list to find the most common solutions.

Click link to get the detailed description of the issues, its cause and the steps to resolve the problem.

Errors List

  • Run-time Error '91': Object variable or With block variable not set

  • Compile Error: Can't find project or library

  • Run-time error '424': Object required

  • Run-time error '13': Type mismatch

  • Compile Error: User-defined type not defined

  • Run-time error '438': object doesn't support this property or method

  • Run-time error '429': ActiveX component can't create object

  • Run-time Error '5': Invalid procedure call or argument

  • Compile error: The code in this project must be updated for use on 64-bit systems is displayed. Please review and update Declare statements and then mark item with the PtrSafe attribute

  • Cannot Open (for VBA macros)

  • Compile error: Invalid outside procedure error

  • SolidWorksMacro doesn't contain a definition for 'swApp' (VSTA)

  • Cannot open (for VSTA macros)

{% catalogue { type: sw-macro-fix } %}