When to use swApp as Object vs swApp as sldworks.sldworks?

300 views Asked by At

I am brand new to Solidworks VBA. In Excel, I followed along the example of "Import STEP File Example (VBA)" and immediately received an error.

The dim swApp as sldworks.sldworks and set swApp = Application.Sldworks returned a Runtime error '438': Object doesn't support this property or method.

Screen shot of references used. SW version 2022:

references used

I tried opening a new Macro from within solidworks and the code showed Dim swApp as object.

Auto references using solidworks:

auto references

Can someone please shed light as to why the example code I found using sldworks.sldworks did not work? Am i missing a library reference or an update of some sort? Most of the example code I have found uses sldworks.sldworks. Not sure what is going on.

0

There are 0 answers