BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Just upgraded to 9.2. All works fine. But when I use excelxp tagsets to create multiple sheet workbooks sas generates one workbook for each sheet.

Does anyone have solution for this problem?

Code used:

ods tagsets.excelxp file=book.xls style=statdoc;
ods tagsets.excelxp options( sheet_name='Sheet A' sheet_interval='proc');
proc tabulate;
ods tagsets.excelxp options( sheet_name='Sheet B' sheet_interval='proc');
proc tabulate;
ods tagsets.excelxp close;
3 REPLIES 3
Cynthia_sas
Diamond | Level 26
HI,
That is very strange. When I run this program:
[pre]
ods tagsets.excelxp file='mywb.xls' style=statdoc;
ods tagsets.excelxp options(sheet_name='Lucy' sheet_interval='proc');
proc tabulate data=sashelp.class;
class age sex;
var height;
table sex,age,
height*(min mean max);
run;

ods tagsets.excelxp options(sheet_name='Ricky' sheet_interval='proc');
proc tabulate data=sashelp.class;
class height sex;
var age;
table sex,height,
age*(min mean max);
run;

ods tagsets.excelxp close;
[/pre]

using SAS 9.2, I get one workbook (mywb.xls) with two worksheets. I suggest that you check your SAS log for errors and, if there are no errors in the LOG, if your code still continues to give you a workbook for each procedure, then you should consider contacting SAS Tech Support for more help.

cynthia
deleted_user
Not applicable
Hello

Thanks for your response.

I have played around with the NEWFILE option. And the following code seems to have resolve my problem.

ods html close;
ods html newfile=bygroup;

/Anders
Cynthia_sas
Diamond | Level 26
Oh, I must have misread your original posting. I thought you wanted only ONE workbook using ODS TAGSETS.EXCELXP. I missed the need for multiple files for every BYGROUP using ODS HTML.

Glad you got it worked out!
cynthia

Catch up on SAS Innovate 2026

Nearly 200 sessions are now available on demand in the Innovate Hub.

Watch Now →
Discussion stats
  • 3 replies
  • 2334 views
  • 0 likes
  • 2 in conversation