ds-blue-logo
Preview  |  SOLIDWORKS USER FORUM
Use your SOLIDWORKS ID or 3DEXPERIENCE ID to log in.
FMFatih Mehmet Ozcan14/12/2017

I have a macro feature in my drawing document. I use it to access custom properties and taking some actions according to their values

When I use main sub when inserting macro feature, there is no problem but after reopening the document it gives an error. I am guessing that main sub doesn't work at reopening. Is macro feature not supposed work like normal macros?

I tried to add some key statements to rebuild function like

Set swApp = Application.SldWorks

Set swmodel = swApp.ActiveDoc

Set swcust = swmodel.Extension.CustomPropertyManager("")

I am not sure this is good coding, I normally don't enter these in any function when working with macros

But still there happens to be an error. If I ignore that error everything seems fine. This is because I thought main sub might be not working as should be in order. I tried writing On Error Resume Next but no avail

Am I missing something? Should I return some values at swmRebulid?