title: Using Excel VBA to change PowerPoint Slide Size - Late Binding
body: <p>I'm new-ish to VBA and brand new to StackOverflow, so please forgive any breaches of etiquette.  I have a project to create a tool using Excel VBA that will allow the user to identify a source Excel file and then copy the print area of every worksheet in the Excel file into a slide in a newly created PowerPoint presentation.  I have to use late binding because I can't assume the users of the tool will all be using the same versions of the Microsoft Office products, or that they will have enabled the reference to the PowerPoint Object Library.  I have managed to do all of this.  Where I am getting hung up is when I try to set the size of the slides - I have been asked for the slides to be in the 4:3 slide size available in PowerPoint 2013 (or a similar ratio if needed to make the tool work in older versions of PowerPoint - I have been trying for ppSlideSizeLetterPaper).  This is throwing "Run-time error '438': Object doesn't support this property or method".  If anyone could offer suggestions as to how to get around this, i'd be grateful.</p>
  
  <p>Here's the relevant snippets of the code:</p>
  
  <pre><code>Public PowerPointApp As Object
  Public TargetFile As Object
  …
  Sub Master()
  Set PowerPointApp = CreateObject("PowerPoint.Application")
  Err.Clear
  If PowerPointApp Is Nothing Then Set PowerPointApp = CreateObject(class:="PowerPoint.Application")
  If Err.Number = 429 Then
      MsgBox "PowerPoint could not be found.  Exiting macro."
      Exit Sub
  End If
  Set TargetFile = PowerPointApp.Presentations.Add
      PowerPointApp.Visible = True
      PowerPointApp.Activate
  …&lt;code to add slides and paste data from Excel into the slides&gt;
  PowerPointApp.TargetFile.PageSetup.SlideSize = 2    ‘this is where the error is thrown.  2 is the numeric equivalent of ppSlideSizeLetterPaper
  </code></pre>