Usage Note 49047: The error "Cannot Expand Named Range" occurs when you export data to Excel files using the SAS® PC Files Server
When you export data to a Microsoft workbook using the SAS PC Files Server, you might receive the following message:
ERROR: CLI execute error: [Microsoft][ODBC Excel Driver] Cannot expand named range.
WARNING: File deletion failed
The problem occurs when the named range has been altered in the Excel worksheet that SAS is attempting to update.
To circumvent the problem, use code similar to that shown below to drop both the worksheet and the named range in the workbook before updating. The named range has the same name as the worksheet but also contains a dollar sign ($).
libname plott pcfiles path="c:\yourdirectory\yourfile.xlsx";
proc sql;
drop table plott.mysheet;
drop table plott.'mysheet$'n;
quit;
libname plott clear;
Operating System and Release Information
SAS System | SAS/ACCESS Interface to PC Files | Microsoft® Windows® for 64-Bit Itanium-based Systems | 9.2 TS2M3 | |
Microsoft Windows Server 2003 Datacenter 64-bit Edition | 9.2 TS2M3 | |
Microsoft Windows Server 2003 Enterprise 64-bit Edition | 9.2 TS2M3 | |
Microsoft Windows XP 64-bit Edition | 9.2 TS2M3 | |
Microsoft® Windows® for x64 | 9.2 TS2M3 | |
Microsoft Windows Server 2003 for x64 | 9.2 TS2M3 | |
Microsoft Windows Server 2008 for x64 | 9.2 TS2M3 | |
Windows 7 Enterprise x64 | 9.2 TS2M3 | |
Windows 7 Home Premium x64 | 9.2 TS2M3 | |
Windows 7 Professional x64 | 9.2 TS2M3 | |
Windows 7 Ultimate x64 | 9.2 TS2M3 | |
Windows Vista for x64 | 9.2 TS2M3 | |
64-bit Enabled AIX | 9.2 TS2M3 | |
64-bit Enabled HP-UX | 9.2 TS2M3 | |
64-bit Enabled Solaris | 9.2 TS2M3 | |
HP-UX IPF | 9.2 TS2M3 | |
Linux | 9.2 TS2M3 | |
Linux for x64 | 9.2 TS2M3 | |
Solaris for x64 | 9.2 TS2M3 | |
*
For software releases that are not yet generally available, the Fixed
Release is the software release in which the problem is planned to be
fixed.
When using the SAS PC Files Server to write to a worksheet in an Excel workbook, you might receive "Cannot Expand Named Range" errors. To resolve the problem, drop both the sheet and the Excel named range before writing to the workbook.
Date Modified: | 2013-08-12 17:01:58 |
Date Created: | 2013-02-01 12:39:35 |