1 Reply Latest reply on Mar 26, 2014 7:23 AM by Abhay Kharade

    Power Select Error

    Craig Funston

      I am trying to use Power Select in a macro. I used the macro recorder to generate the code. It works fine until I close SolidWorks. When I reopen SolidWorks and try to run the macro I get a run time error 91. If I manually perform a Power Select then the macro will work, and continue to work, until I close Solidworks again.

       

      Has anyone seen this before? Am I doing something wrong?

        • Re: Power Select Error
          Abhay Kharade

          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:

           

          1. 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.

          OR

           

          2.You can load “SolidWorks Utilities” Addin with using LoadAddIn Method (ISldWorks)