6 Replies Latest reply on Sep 12, 2017 4:08 PM by Christian Chu

    Run recorded macro on all files in folder

    Grant Kirkland

      I wish to change all configuration names with are "Default" to "00".

      I have the recorded macro below which works on the open part. How can I modify this to run on all parts in a given folder?


      Thanks in advance!


      Dim swApp As Object



      Dim Part As Object

      Dim boolstatus As Boolean

      Dim longstatus As Long, longwarnings As Long



      Sub main()



      Set swApp = Application.SldWorks



      Set Part = swApp.ActiveDoc

      Dim myModelView As Object

      Set myModelView = Part.ActiveView

      myModelView.FrameState = swWindowState_e.swWindowMaximized

      boolstatus = Part.Extension.SelectByID2("Default", "CONFIGURATIONS", 0, 0, 0, False, 0, Nothing, 0)

      boolstatus = Part.EditConfiguration3("Default", "00", "", "", 36)



      End Sub