In your case when you reopen the SolidWorks Session, “SolidWorks Utilities” Addin not loaded and you are trying to get Addin Object of this unloaded Addin with using following line of code.
Set swUtil = swApp.GetAddInObject("Utilities.UtilitiesApp"). => throws run time error 91.
So you need to load “SolidWorks Utilities” Addin before above mentioned code snippet. There are 2 ways for loading the Add-in in SolidWorks Session these are as follows:
- In SolidWorks UI, Select Tools -> Add-Ins.. , It opens Add-Ins dialog box. In SolidWorks Add-in section -> SolidWorks Utilities -> Check Start up check box -> click Ok.
With these settings “SolidWorks Utilities” Addin loaded in your SolidWorks session at Startup only and no need to load the add-in manually.
2.You can load “SolidWorks Utilities” Addin with using LoadAddIn Method (ISldWorks)