title: Powerpoint vba update slide master
body: <p>I have a modest but growing collection (~20) of PowerPoint presentations that are all based on the same master slide. What I would like to do is to ensure that if I create a new layout or modify an existing layout on any of those files that I can update all of the other presentations to reflect this programatically. Here is my attempt. I have shown the error that it generates above the line.</p>
  
  <pre><code>Sub UpdateTemplates()
  
  Dim colFiles As New Collection
  Dim vFile As Variant
  Dim ppPres As Presentation
  
  RecursiveDir colFiles, "C:\Users\Debra\Dropbox\School\Mathematics\Notes\Data", "*.pptm", True
  
  For Each vFile In colFiles
      Debug.Print "Updating templates in " &amp; vFile
      Set ppPres = Presentations.Open(vFile)
      ppPres.ApplyTemplate ("C:\Users\Debra\Dropbox\School\Mathematics\Notes\Topic Blank.potm")
  
  Next vFile
  
  End Sub
  </code></pre>