title: Excel 2011 for Mac - outputting PDF fails if File->Print selected beforehand
body: <p>I have written a Macro-Enabled Workbook in Excel for Windows, and am now trying to get it to work in Excel 2011 for Mac.  One thing my workbook does is allow the user to create a PDF of whatever sheets they want.</p>
  
  <p>My code works fine on Excel 2011 under normal circumstances.  However, if I go to File -> Print and then hit Cancel, anytime I attempt to output the PDF after that, the code results in an error </p>
  
  <blockquote>
    <p>Run-time 1004: Application-defined or object-defined error</p>
  </blockquote>
  
  <p>on this line of code:</p>
  
  <pre><code>ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, filename:= _
      FilePathName, Quality:=xlQualityStandard, _
      IncludeDocProperties:=True, IgnorePrintAreas:=False
  </code></pre>
  
  <p>If I close Excel and relaunch my workbook and attempt to create the PDF, it works fine again.  So somehow, the act of clicking File -> Print is doing something to cause the code to fail.</p>
  
  <p>Anyone have any idea why this is happening, and what I can do about it?  My file will be used by many different people, and I have no control over if they might hit File -> Print at some point while using it.</p>