🔒 This topic is solved and locked.
Need further help from the community? Please
sign in and ask a new question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Posted 12-27-2021 12:26 PM
(2834 views)
Hi,
When creating a new worksheet using contents=yes, this new worksheet is named "The Table of Contents".
Is there a way to change this name e.g. to TOC or to "Table des matières" for example ?
I've looked into the template but couldn't find any prespecified text for the tab name.
Using locale=FR_FR does not change the worksheet name.
The same problem occurs with index='yes'.
ods excel file="&xxtest./reporting/ods_excel_test.xlsx"
options(contents='yes');
ods excel options(sheet_name='Male');
proc print data=sashelp.class noobs;
where sex='M';
run;
ods excel options(sheet_name='Female');
proc print data=sashelp.class noobs;
where sex='F';
run;
ods excel close;
1 ACCEPTED SOLUTION
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
An XLSX file is just a ZIP with special content.
So just change the name yourself.
Example: Change sheet name to TOC.
ods excel file="c:\downloads\toc.xlsx"
options(contents='yes' sheet_name='TOC')
;
ods excel options(sheet_name='Male');
proc print data=sashelp.class noobs;
where sex='M';
run;
ods excel options(sheet_name='Female');
proc print data=sashelp.class noobs;
where sex='F';
run;
ods excel close;
filename copy temp;
data _null_;
infile 'C:\downloads\toc.xlsx' zip member='xl/workbook.xml';
input;
file copy ;
_infile_=tranwrd(_infile_,'sheet name="The Table of Contents"','sheet name="TOC"');
put _infile_;
run;
data _null_;
infile copy;
file 'C:\downloads\toc.xlsx' zip member='xl/workbook.xml';
input;
put _infile_;
run;
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
An XLSX file is just a ZIP with special content.
So just change the name yourself.
Example: Change sheet name to TOC.
ods excel file="c:\downloads\toc.xlsx"
options(contents='yes' sheet_name='TOC')
;
ods excel options(sheet_name='Male');
proc print data=sashelp.class noobs;
where sex='M';
run;
ods excel options(sheet_name='Female');
proc print data=sashelp.class noobs;
where sex='F';
run;
ods excel close;
filename copy temp;
data _null_;
infile 'C:\downloads\toc.xlsx' zip member='xl/workbook.xml';
input;
file copy ;
_infile_=tranwrd(_infile_,'sheet name="The Table of Contents"','sheet name="TOC"');
put _infile_;
run;
data _null_;
infile copy;
file 'C:\downloads\toc.xlsx' zip member='xl/workbook.xml';
input;
put _infile_;
run;