Welcome

How to fix merged SOLIDWORKS macro errors

Edit ArticleEdit Article
See more issues and resolutions

Symptoms

SOLIDWORKS macros work correctly independently but failed to work when merged to one. Possibly, the error is displayed: Run-time error '424': Object required

Run-time error '424': Object required when running the macro
Run-time error '424': Object required when running the macro

Cause

  • Merged macros might not be compatible
  • There might be required initialization from the source macro which was not copied to the destination macro
  • Variable naming might be different between source and target macros

Code block inserted from recorded macro
Code block inserted from recorded macro

Resolution

  • Identify which line fails
  • Check the state of variables. Hover the mouse and see if it is not shown as *Nothing *in the tooltip.
  • Make sure that the correct portion of the macro is copied
  • Make sure that required initialization is copied as well (if applicable)
  • Make sure that the variables naming is consistent

Notifications

Join session by SOLIDWORKS and PDM API expret Artem Taturevych at 3DEXPERIENCE World 2025 on Feb 26 at 08:30 AM CST to explore 10 essential macros for automating drawings, assemblies, custom properties, and more


Product of Xarial Product of Xarial