title: Exporting sheet template to PDF generates Runtime Error 5: Invalid Procedure call or argument
body: <p>I have created a macro to export the sheet template to PDF:</p>
  
  <pre><code>ActiveWorkbook.Sheets("Sheet2").ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
    ActiveWorkbook.Path &amp; "\Survey Report.pdf", _
  Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
    :=False, OpenAfterPublish:=True
  </code></pre>
  
  <p>I tried it other ways but it makes no difference in error.</p>
  
  <p>Links already tried:</p>
  
  <ol>
  <li><a href="http://www.mrexcel.com/forum/excel-questions/608810-printing-multiple-worksheets-pdf-2.html" rel="nofollow noreferrer">http://www.mrexcel.com/forum/excel-questions/608810-printing-multiple-worksheets-pdf-2.html</a></li>
  <li><a href="http://www.mrexcel.com/forum/microsoft-access/385749-exportasfixedformat-error.html" rel="nofollow noreferrer">http://www.mrexcel.com/forum/microsoft-access/385749-exportasfixedformat-error.html</a></li>
  <li><a href="http://answers.microsoft.com/en-us/office/forum/office_2010-customize/error-5-invalid-procedure-call-or-argument/574c2c8f-7f2c-4644-9373-bbc14c8d3fd7?msgId=4dbee3f3-ad28-4427-a50b-a3904b09ec1e" rel="nofollow noreferrer">http://answers.microsoft.com/en-us/office/forum/office_2010-customize/error-5-invalid-procedure-call-or-argument/574c2c8f-7f2c-4644-9373-bbc14c8d3fd7?msgId=4dbee3f3-ad28-4427-a50b-a3904b09ec1e</a></li>
  </ol>