Database Reference
In-Depth Information
Example 8.16.7 Methods of Naming Excel Worksheets
Up until Example 8.16.5, the examples for ExcelXP had output only a single worksheet in the output Excel
workbook, and the selection of the sheet name was left up to ExcelXP. Example 8.16.6 created more than
one output worksheet, but ExcelXP still assigned the names of the worksheets. This example will use the
SHEET_NAME option to give SAS control over creating the worksheet names.
Table 8.14: Options Used in Example 8.16.7.
ExcelXP Option
Setting in Example
Result
SHEET_NAME
'All Regions'
Create a worksheet with the
specified name. When only one
worksheet is output, this is the name
generated, up to 32 characters.
Figure 8.41: SAS Code to Assign a Worksheet Name.
ODS TAGSETS.EXCELXP BODY='c:\temp\ExcelXP\shoes7.xml'
OPTIONS(SHEET_NAME='All Regions' );
PROC PRINT DATA=sashelp.shoes;
RUN;
ODS TAGSETS.EXCELXP CLOSE;
By using this SAS ExcelXP option, you can rename the spreadsheets directly when they are being built,
without opening Excel to change the sheet name. See Figure 8.42.
Figure 8.42: Excel Workbook with a Sheet Name Assigned as the File Was Written.
I did compress the width of the columns to display all of the columns but the name was assigned when the
file was generated.
 
Search WWH ::




Custom Search