Colin Hayes said:
I'm using Excel 2003 and need to save a file as .xlsx so it
can be read in Excel 2007.
I'd like to add some VBA at the end of my macro to save the
workbook in this format. (myfile.xlsx)
Can someone advise if this is possible please?
Colin Hayes said:
["Ron Rosenfeld said:
Excel 2007 can read .xls files - no need to save them as
.xlsx which, so far as I know, is not possible using Excel 2003
[....]
The issue is that I'm being asked to upload a file to a parser
in xlsx format. It's an automated upload system.
I'm wondering if it will accept my xls file with no issues?
There is no way for anyone to say for sure since you do not tell us the name
of the "parser" product, and even if you did, we probably do not know how
the "parser" works anyway.
There are other good reasons for saving an Excel 2003 file as .xlsx (or
..xlsm). Some of there are:
1. So that the file is not limited to 256 columns and 65536 rows when opened
in Excel 2007 or later.
2. So that formulas are not recalculated when the file is opened in Excel
2007 or later.
3. So that the user of Excel 2007 or later does not get needless warnings
when saving the modified file.
In order to save as .xlsx or .xlsm using Excel 2003, download the Office
Compatibility Pack. See
http://support.microsoft.com/kb/2526297.
Then you can use the following VBA code to save as .xlsx and optionally
close the file.
ActiveWorkbook.SaveAs Filename:= _
"driveName:\fullPath\myfile.xlsx", FileFormat:=51
ActiveWindow.Close
(Of course, replace "driveName" and "fullPath" with appropriate names.)
That will automatically invoke the file converter in the Compatibility Pack.
However, that presumes that the macro is not part of the saved file (i.e. it
is in another workbook), or that you do not intend for the macro to be saved
with the file.
If, instead, you want to save the macro with the XL2007-compatible file, you
need to save with the extension .xlsm. Also, change the FileFormat to 52
instead of 51.