SUPPORT / SAMPLES & SAS NOTES
 

Support

Sample 43496: Convert files created using an ODS destination to native Microsoft Excel files

DetailsCodeResultsDownloadsAboutRate It

Various ODS destinations, such as ExcelXP, MSOffice2K, HTML, and CSV, can generate files that can be read by Microsoft Excel. Because some of the file formats that are generated from the ODS destinations create XML output, the file size can become fairly large as the number of observations grows.

The sample code on the Full Code tab, along with the attached macro, enables you to convert all of the files in a specified directory to native Microsoft Excel files.

The macro converts files based on the version of Microsoft Excel that you have installed. If you have Microsoft Excel 2007 or higher installed, the files are converted to the Open Compressed XML format (XLSX) by default. If the version of Microsoft Excel that you have installed is a version prior to 2007, the files are converted to the Excel binary format (XLS) by default. The macro uses VBScript to perform the conversion and can be modified to change the defaults. Click on the Downloads tab to download the macro.




These sample files and code examples are provided by SAS Institute Inc. "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and fitness for a particular purpose. Recipients acknowledge and agree that SAS Institute shall not be liable for any damages whatsoever arising out of their use of this material. In addition, SAS Institute will provide no support for the materials contained herein.