title: Excel 2010 VBA macro to change the content of a module in another file
body: <p>I have developed a macro to mass update files in a file location. Im using the following code, which works perfectly, however the Edit part of the script requires changes in a VBA module in each of the files for the changes in the call edit macro to work. How can i also mass update the module contents when performing the mass file update. </p>
  
  <pre><code>Sub Auto_open_change()
  
      Dim WrkBook As Workbook
      Dim StrFileName As String
      Dim FileLocnStr As String
      Dim LAARNmeWrkbk As String
  
      PERNmeWrkbk = ThisWorkbook.Name
  
  
      FileLocnStr = "C:\Users\gornalla\Desktop\PER Update" 'ThisWorkbook.Path
  
      Dim StrFile As String
      StrFile = Dir(FileLocnStr &amp; "\*.xlsm")
      Do While Len(StrFile) &gt; 0
          DoStuff (FileLocnStr &amp; "\" &amp; StrFile)
          StrFile = Dir
      Loop
  
  End Sub
  
  Private Sub DoStuff(StrFileName)
  
      Workbooks.Open (StrFileName)
      'Workbooks(StrFileName).Activate
      ActiveSheet.Unprotect ("147258369")
      Sheets("Property Evaluation Report").Select
      ActiveSheet.Unprotect ("147258369")
  
          Call Edit
  
      ActiveWorkbook.RefreshAll
      Sheets("Property Evaluation Report").Select
      ActiveSheet.Protect Password:="147258369", DrawingObjects:=True, Contents:=True, Scenarios:=True, AllowUsingPivotTables:=True
      ActiveWorkbook.Close
  
      Application.SendKeys ("Enter")
  
  End Sub
  </code></pre>