title: Controlling PowerPoint Using Excel-VBA (Minimize etc)
body: <p>I just altered my code to make it compatible with all versions of office (hence independent of the PowerPoint 15.0 library). While the code works, I'm running into minor problems I need to address for my work. The code and error are given below. Would really appreciate the help. Thanks!</p>
  
  <p>The new code</p>
  
  <pre><code>Dim pptApp As Object
  Set pptApp = CreateObject("Powerpoint.Application")
  pptApp.Visible = True
  pptApp.WindowState = ppWindowMinimized
  </code></pre>
  
  <p>Error - <code>Compile Error. Variable not defined.</code>
  Error for - "ppWindowMinimized"</p>
  
  <p>The old code with which the "ppWindowMinimized" worked</p>
  
  <pre><code>Dim pptApp As PowerPoint.Application
  Set pptApp = New PowerPoint.Application
  pptApp.Visible = True
  pptApp.WindowState = ppWindowMinimized
  </code></pre>
  
  <p>I am facing the same error with the following statement as well for the new code:</p>
  
  <pre><code>pptApp.ActiveWindow.viewtype = ppViewNormal
  myPPT.SaveAs target_dir, ppSaveAsDefault
  </code></pre>