AnsweredAssumed Answered

Macro feature main and rebuild question

Question asked by Fatih Mehmet Ozcan on Dec 13, 2017
Latest reply on Dec 21, 2017 by Jacob Corder

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?