title: How to use PROC EXPORT to export to multiple tabs in Excel
body: <p>I have a handful of SAS datasets in my project file, which I would like to combine into one spreadsheet - each dataset on a different tab.  I found a solution here: <a href="https://communities.sas.com/thread/58447" rel="nofollow">https://communities.sas.com/thread/58447</a> but it is not working for me.  The code I am using is:</p>
  
  <pre><code>proc export data=work.dod_ltd file='H:\Projects\DOD_Report\Sample.xlsx' dbms=xlsx; sheet='LTD Detail';
  proc export data=work.dod_std file='H:\Projects\DOD_Report\Sample.xlsx' dbms=xlsx; sheet='STD Detail';
  proc export data=work.dod_life_waiver file='H:\Projects\DOD_Report\Sample.xlsx' dbms=xlsx; sheet='Waiver Detail';
  run;
  </code></pre>
  
  <p>However, instead of adding new tabs, each proc export is overwriting the existing 'Sample.xlsx' file, so I end up with only the 'Waiver Detail' tab.</p>
  
  <p>How do I make it add the tabs to an existing spreadsheet?</p>
  
  <p>Thanks!</p>
  
  <p>Mike</p>