Declaring Variables in a macro
Declaring Variables in a macro
(OP)
Maybe I have missed something in the API help files, but when I try to set a variable like so:
Dim swApp As SldWorks.SldWorks
I get an error. Why not set is as an object you may ask. It works that way, but all of the SW API help files have it listed as above but I cant get it to work. Any insight?
Thanks,
Brian
Dim swApp As SldWorks.SldWorks
I get an error. Why not set is as an object you may ask. It works that way, but all of the SW API help files have it listed as above but I cant get it to work. Any insight?
Thanks,
Brian






RE: Declaring Variables in a macro
Perhaps your VBA install is self-destructing, guessing from your previous recent posts.
Otherwise, make sure the macro is referencing the SW type library. If the macro started life recorded from SW, this shouldn't be a problem.
http://www.EsoxRepublic.com
RE: Declaring Variables in a macro
RE: Declaring Variables in a macro
When you are editing a macro, in the VBA environment, go to Tools\References.
Check if the box Sldw 2004 type library is selected. If not, VBA will fail to recognize some API from Solidworks.
Good Luck
RE: Declaring Variables in a macro