Usage Note 34920: An error occurs when you open a new XLSX file that was created with SAS/ACCESS® Interface to ODBC
When opening a new XLSX file that was created with SAS/ACCESS Interface to ODBC, you receive the following message:
Excel cannot open the file 'yourfile.xlsx' because the file
format or the file extension is not valid. Verify that the
file has not been corrupted or that the file extension matches
the format of the file.
The problem occurs only with new files created with SAS/ACCESS Interface to ODBC, having used the code below:
libname myxls odbc required=
"Driver={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)};
DBQ=c:\sastest\myfile6.xlsx;READONLY=FALSE";
data myxls.class;
set sashelp.class;
run;
The problem occurs because new XLSX files are created with a binary format and need an .xlsb extension (rather than a .xlsx extension) in order to open properly in Excel.
To circumvent this problem, you should perform one of the following steps:
- Rename the XLSX file that was created. Use a .xlsb extension, renaming myfile.xlsx to myfile.xlsb.
- Create a new XLSX file with Excel and then export your SAS data to the existing XLSX file.
Operating System and Release Information
| SAS System | SAS/ACCESS Interface to ODBC | Microsoft Windows Server 2003 Datacenter 64-bit Edition | 9.1 TS1M3 | |
| Microsoft Windows Server 2003 Enterprise 64-bit Edition | 9.1 TS1M3 | |
| Microsoft Windows XP 64-bit Edition | 9.1 TS1M3 | |
| Microsoft® Windows® for x64 | 9.1 TS1M3 | |
| Microsoft Windows 2000 Advanced Server | 9.1 TS1M3 | |
| Microsoft Windows 2000 Datacenter Server | 9.1 TS1M3 | |
| Microsoft Windows 2000 Server | 9.1 TS1M3 | |
| Microsoft Windows 2000 Professional | 9.1 TS1M3 | |
| Microsoft Windows NT Workstation | 9.1 TS1M3 | |
| Microsoft Windows Server 2003 Datacenter Edition | 9.1 TS1M3 | |
| Microsoft Windows Server 2003 Enterprise Edition | 9.1 TS1M3 | |
| Microsoft Windows Server 2003 Standard Edition | 9.1 TS1M3 | |
| Microsoft Windows XP Professional | 9.1 TS1M3 | |
| Windows Vista | 9.1 TS1M3 | |
*
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 you create new Microsoft Excel files using SAS/ACCESS Interface to ODBC, the Microsoft ODBC driver creates an .xlsb binary rather than an XLSX XML text-based Excel file.
| Date Modified: | 2009-02-25 10:39:50 |
| Date Created: | 2009-02-23 15:18:58 |