Beginning with release 8.0, the ODS EXCEL destination is supported in the SAS Add-In for Microsoft Office with the following requirements:
- The ODS EXCEL stored process must execute on either a SAS 9.4_M5 workspace server or a SAS 9.4_M5 stored process server.
- The macro variables &_ODSDEST and &_ODSOPTIONS must be defined as shown in the following sample code. Note that the macro variable statements must be inserted before the %STPBEGIN; statement.
Sample ODS EXCEL stored process code:
*Process Body;
%let _odsdest=EXCEL;
%let _odsoptions=;
%stpbegin;
ods EXCEL options(sheet_interval="proc" sheet_name="Male Students");
proc print data=sashelp.class(where=(sex="M"));
run;
ods EXCEL options(sheet_name="Female Students");
proc print data=sashelp.class(where=(sex="F"));
run;
ods EXCEL close;
%stpend;
Note: You cannot refresh a Microsoft Excel file that is created from a stored process containing ODS Excel code that is executed in the SAS Add-In for Microsoft Office.