<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Export to excel with color on multiple sheet in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Export-to-excel-with-color-on-multiple-sheet/m-p/527606#M22185</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I try to export data to Excel with color using the following code&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, it only export the last sheet.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, how to add REPLACE option as in proc export?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any help is very much appreciated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;HHCFX&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
ods listing close;
ods excel file="C:\Users\_temp\exp.xlsx"   
                    options (sheet_interval = "none" sheet_name = "SHEET1" );

		proc report data=sashelp.class nowd;
		compute name;
		call define (_col_,"style","style={background=lightgray}");
			endcomp;
		run;

ods excel close;


ods listing close;
ods excel file="C:\Users\_temp\exp.xlsx"   
                    options (sheet_interval = "none" sheet_name = "SHEET2" );

		proc report data=sashelp.class nowd;
		compute Weight;
		call define (_col_,"style","style={background=lightgray}");
			endcomp;
		run;

ods excel close;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 16 Jan 2019 02:46:55 GMT</pubDate>
    <dc:creator>hhchenfx</dc:creator>
    <dc:date>2019-01-16T02:46:55Z</dc:date>
    <item>
      <title>Export to excel with color on multiple sheet</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Export-to-excel-with-color-on-multiple-sheet/m-p/527606#M22185</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I try to export data to Excel with color using the following code&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, it only export the last sheet.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, how to add REPLACE option as in proc export?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any help is very much appreciated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;HHCFX&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
ods listing close;
ods excel file="C:\Users\_temp\exp.xlsx"   
                    options (sheet_interval = "none" sheet_name = "SHEET1" );

		proc report data=sashelp.class nowd;
		compute name;
		call define (_col_,"style","style={background=lightgray}");
			endcomp;
		run;

ods excel close;


ods listing close;
ods excel file="C:\Users\_temp\exp.xlsx"   
                    options (sheet_interval = "none" sheet_name = "SHEET2" );

		proc report data=sashelp.class nowd;
		compute Weight;
		call define (_col_,"style","style={background=lightgray}");
			endcomp;
		run;

ods excel close;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 16 Jan 2019 02:46:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Export-to-excel-with-color-on-multiple-sheet/m-p/527606#M22185</guid>
      <dc:creator>hhchenfx</dc:creator>
      <dc:date>2019-01-16T02:46:55Z</dc:date>
    </item>
    <item>
      <title>Re: Export to excel with color on multiple sheet</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Export-to-excel-with-color-on-multiple-sheet/m-p/527627#M22187</link>
      <description>&lt;P&gt;Because you have to ODS EXCEL calls it overwrites the previous results with just the final results. If you want the output into two sheets in the same workbook you can simply not close the destination between PROCS.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods listing close;
ods excel file="/folders/myfolders/exp.xlsx"   
                    options (sheet_interval = "proc" sheet_name = "SHEET1" );

        proc report data=sashelp.class nowd;
        compute name;
        call define (_col_,"style","style={background=lightgray}");
            endcomp;
        run;


ods excel  options (sheet_interval = "proc" sheet_name = "SHEET2" );

        proc report data=sashelp.class nowd;
        compute Weight;
        call define (_col_,"style","style={background=lightgray}");
            endcomp;
        run;

ods excel close;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;AFAIK there is no REPLACE option specifically,&amp;nbsp;but appears to be the default. You cannot append ODS EXCEL data to an existing Excel file or template.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/49486"&gt;@hhchenfx&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I try to export data to Excel with color using the following code&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, it only export the last sheet.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, how to add REPLACE option as in proc export?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any help is very much appreciated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;HHCFX&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
ods listing close;
ods excel file="C:\Users\_temp\exp.xlsx"   
                    options (sheet_interval = "none" sheet_name = "SHEET1" );

		proc report data=sashelp.class nowd;
		compute name;
		call define (_col_,"style","style={background=lightgray}");
			endcomp;
		run;

ods excel close;


ods listing close;
ods excel file="C:\Users\_temp\exp.xlsx"   
                    options (sheet_interval = "none" sheet_name = "SHEET2" );

		proc report data=sashelp.class nowd;
		compute Weight;
		call define (_col_,"style","style={background=lightgray}");
			endcomp;
		run;

ods excel close;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Jan 2019 04:34:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Export-to-excel-with-color-on-multiple-sheet/m-p/527627#M22187</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-01-16T04:34:54Z</dc:date>
    </item>
    <item>
      <title>Re: Export to excel with color on multiple sheet</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Export-to-excel-with-color-on-multiple-sheet/m-p/528959#M22223</link>
      <description>&lt;P&gt;Thank you,&lt;/P&gt;
&lt;P&gt;HHC&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jan 2019 03:07:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Export-to-excel-with-color-on-multiple-sheet/m-p/528959#M22223</guid>
      <dc:creator>hhchenfx</dc:creator>
      <dc:date>2019-01-22T03:07:46Z</dc:date>
    </item>
  </channel>
</rss>

