1 Reply Latest reply on Jan 23, 2012 9:08 AM by Deepak Gupta

    escape macro

    Marc Hervouet-Botta

      i am trying to make a macro that emulates ESC key .

       

      I saved the following code

       

      Sub main()

      SendKeys "{ESC}"

      End Sub

       

      to a .swp file using notepad .  I then tried create the macro with "new macro" button on macro toolbar .  But when browsing for a macro , my swp file is not accepted.  

       

      thanks for any help

        • Re: escape macro
          Deepak Gupta
          1. Go to Tools > Macro > New.
          2. Save the macro at desired location
          3. Now replace the codes in that with following codes
          4. Save the macro and check.

           

          Option Explicit
          Dim swApp As SldWorks.SldWorks
          Dim swModel As SldWorks.ModelDoc2

          Sub main()

          Set swApp = Application.SldWorks
          Set swModel = swApp.ActiveDoc

           

          SendKeys "{ESC}"

           

          End Sub