The SAS Output Delivery System and reporting techniques

Export to MultiSheet Excel File

Reply
Regular Contributor
Posts: 181

Export to MultiSheet Excel File

I am trying to send my results to multi-sheet excel files. My results includes table, title and GRAPH. My code is working fine. But it is creating two workbooks. One for tables and other for GRAPH. I am unable to insert GRAPH into the same file. I have tried TAGSETS.MSOFFICE2K_X but it is not working.

WARNING: Tagset TAGSETS.MSOFFICE2K_X not found; the default tagset will be used instead.

 

ods tagsets.excelxp file='C:\Users\Ujjawal\Documents\multitable.xls' style=STATISTICAL 
options(sheet_name='Summary' skip_space='1,0,0,0,1' EMBEDDED_TITLES='yes' sheet_interval='none' suppress_bylines='no');
Title " First File";
proc freq data = sashelp.class;
table sex;
run;
data temp2;
set sashelp.cars;
Title " Second File";
proc print;
run;
ods tagsets.excelxp 
options(sheet_name='FREQ' skip_space='1,0,0,0,1' EMBEDDED_TITLES='yes' sheet_interval='none' suppress_bylines='no');
Title " Third File";
proc freq data = sashelp.cars;
table make;
run;
ods tagsets.excelxp close;

ods msoffice2k path='C:\Users\Ujjawal\Documents' (url=none)
         gpath='C:\Users\Ujjawal\Documents' (url=none)
         file="file1.xls";
proc sgplot data= sashelp.cars;
vbar make;
run;
ods msoffice2k close;

 

Grand Advisor
Posts: 16,264

Re: Export to MultiSheet Excel File

What version of SAS do you have?

Have you downloaded the latest tagsets version from the ODS website?

https://support.sas.com/rnd/base/ods/odsmarkup/index.html

 

If you have 9.4+ you can look into ODS Excel which can incorporate both graphs and tables.

 

Unfortunately there isn't a good destination before to incorporate both easily. You can do it, just not as straightforward as you like. Look for papers or examples on here from Cynthia Zender on how to accomplish this.

 

 

Respected Advisor
Posts: 2,900

Re: Export to MultiSheet Excel File

[ Edited ]

You can't mix different tagsets in the same Excel workbook. It has to be either all EXCELXP or all MSOFFICE2K.

 

What happens if you try to put the graph in EXCELXP?

Post a Question
Discussion Stats
  • 2 replies
  • 278 views
  • 2 likes
  • 3 in conversation