title: VBA macro to mass update multiple files in same location
body: <p>Very new to this so please help. Im trying to mass update files in a static folder location, many files in one folder.</p>
  
  <p>What i want to do is </p>
  
  <ul>
  <li>run VBA macro in Excel 2010 to goto a network location folder,</li>
  <li>open the first file in the folder. </li>
  <li>Unprotect the workbook and worksheets call another marco to run changes</li>
  <li>then protect the worksheet close the file </li>
  <li>and then move onto the next file in the folder until all files have been corrected.</li>
  </ul>
  
  <p>I have created the marco to make the changes, this is called "Edit"</p>
  
  <p>File types are xlsm and the workbook and worksheet are password protected How can i automatically run the macro to goto the network location and in series open each file, unprotect, call the macro, then re protect the document close file and move onto the next file until they are all updated.</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
  StrFileName = "*.xlsx"
  FileLocnStr = ThisWorkbook.Path
  Workbooks.Open (FileLocnStr &amp; "\" &amp; StrFileName)
  Workbooks(StrFileName).Activate
  
  With Application.FindFile
  SearchSubFolders = False
  LookIn = "Network location"
  Filename = "*.xlsm"
  If .Execute &gt; 0 Then
      Debug.Print "There were " &amp; .FoundFiles.Count &amp; " file(s) found."
      For i = 1 To .FoundFiles.Count
          WrkBook = Workbooks.Open(Filename:=.FoundFiles(i))
          WrkBook.Worksheets(1).Select
          ThisWorkbook.Worksheets(1).Cells(DestinationRange) = WrkBook.Worksheets(1).Cells(SourceRange).Value
      Next i
  Else
      Debug.Print "There were no files found."
  
  End If
  </code></pre>
  
  <p>Im  managing to unprotect the file update and reprotect the file fine, just cant get the file from the network location.</p>