Can anybody help???
Is it possible to automatically run a SolidWorks VBA macro every time I close a document (Assembly, Part or Drawing)?
Could it be done with a Vb.net Addin?
Many thanks in advance!!!!
Yes, it could be done. You need to catch the DestroyNotify2 of AssemblyDoc, PartDoc and DrawingDoc and call the SldWorks::RunMacro2 from the event handler.
Another possibility, if the macro would only be run right before you close a document, would be to put the close procedure at the end of the macro.
what is your real need with the macro? Yes it can be done but I would prefer Matt's method of running a macro to do whatever you want and then close the file.
Retrieving data ...