ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro to save 2007 file in 97-2003 format (https://www.excelbanter.com/excel-programming/428600-macro-save-2007-file-97-2003-format.html)

John[_140_]

Macro to save 2007 file in 97-2003 format
 
I'm trying to make a macro that will automatically save an Excel 2007 file
in the 97-2003 file format. So far I have this:
ActiveWorkbook.SaveAs Filename:=ActiveWorkbook.FullName, _
FileFormat:=xlExcel8, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False

The Active Workbook.FullName wants to save the file with the .xlsm extension
though the FileFormat=xlExcel8, so I'm confued. Help, please.



Ron de Bruin

Macro to save 2007 file in 97-2003 format
 
Look here
http://www.rondebruin.nl/saveas.htm

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm




"John" wrote in message ...
I'm trying to make a macro that will automatically save an Excel 2007 file
in the 97-2003 file format. So far I have this:
ActiveWorkbook.SaveAs Filename:=ActiveWorkbook.FullName, _
FileFormat:=xlExcel8, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False

The Active Workbook.FullName wants to save the file with the .xlsm extension
though the FileFormat=xlExcel8, so I'm confued. Help, please.



OssieMac

Macro to save 2007 file in 97-2003 format
 
If you were to run the following line of code just before the save you would
see that you have the .xlsm extension on the name you are using to save the
file.

You need to create a variable for the current name and then replace the
..xlsm with .xls.

MsgBox ActiveWorkbook.FullName

--
Regards,

OssieMac


"John" wrote:

I'm trying to make a macro that will automatically save an Excel 2007 file
in the 97-2003 file format. So far I have this:
ActiveWorkbook.SaveAs Filename:=ActiveWorkbook.FullName, _
FileFormat:=xlExcel8, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False

The Active Workbook.FullName wants to save the file with the .xlsm extension
though the FileFormat=xlExcel8, so I'm confued. Help, please.





All times are GMT +1. The time now is 10:07 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com