title: Export EXCEL Workbook as PDF through SAP
body: <p>I am using the <a href="http://msdn.microsoft.com/en-us/library/bb238907%28v=office.12%29.aspx" rel="nofollow noreferrer">ExportAsFixedFormat</a> method of <em>EXCEL</em>, in order to <strong>export</strong> a <strong>workbook</strong> in <strong>PDF</strong> through <em>ABAP</em>.</p>
  <p><em><strong>Desired outcome:</strong></em> I want to save the entire workbook, instead of saving only the active sheet.</p>
  <p><em><strong>Issue:</strong></em> My problem is that I cannot use the <a href="http://msdn.microsoft.com/en-us/library/microsoft.office.interop.word._document.exportasfixedformat%28v=office.14%29.aspx?cs-save-lang=1&amp;cs-lang=vb#code-snippet-1" rel="nofollow noreferrer">range</a> parameter as it seems that it has no effect in <em>EXCEL</em>.</p>
  <p>I tried recording a macro in <em>EXCEL</em> using the <em>Save As Type:</em> <strong>PDF</strong>, and selecting the <strong>Entire Workbook</strong> in the <strong>Publish What</strong> section of the <strong>Options</strong>.</p>
  <p>Unfortunately, whether you only set in the <strong>Options</strong> the <strong>Active Sheet(s)</strong>, or the <strong>Entire Workbook</strong>, the macro that is recorded is exactly the same (shown bellow), since I guess the options are included in the <strong>IncludeDocProperties</strong>, which I cannot pass through my current method.</p>
  <p>Macro:</p>
  <pre><code>ActiveWorkbook.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
      &quot;C:\foo.pdf&quot;, Quality:=xlQualityStandard, _
      IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:= _
      False
  </code></pre>
  <p>Taking into consideration the code bellow, which I am currently using in my class method. I am looking for a way to alter my selection of the Active Sheet(s) or finding a way to pass the desired option of publishing the Entire Workbook.</p>
  <p>Please note that I want to find a solution through ABAP coding and not through VBA, since my options are limited. Also the amount of sheets that are included in the Workbook is unknown, as they are populated dynamically. Using the select option would not be in favor of the application.</p>
  <p>ABAP Method:</p>
  <pre><code>call method of worksheet 'ExportAsFixedFormat'
    exporting
    #1 = '0'
    #2 = fullpath.
  </code></pre>
  <p>Thanks in advance for any comments.</p>