Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Saving as .xlsx from VBA MACRO

I am attempting to save files through a MACRO as .xlsx files using
getclosefilename function. I have Excell 2007 set to save all files as .xls
files. When I save the files, it places the .xlsx extension, but saves in
..xls format. I cannot open the files as they are, but can after changing the
extension to .xls through Explorer they open just fine.

How do I set Excel 2007to save files as .xlsx through the MACR VBA?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,123
Default Saving as .xlsx from VBA MACRO

Hi Don

See
http://www.rondebruin.nl/saveas.htm



--

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


"Donhuff" wrote in message ...
I am attempting to save files through a MACRO as .xlsx files using
getclosefilename function. I have Excell 2007 set to save all files as .xls
files. When I save the files, it places the .xlsx extension, but saves in
.xls format. I cannot open the files as they are, but can after changing the
extension to .xls through Explorer they open just fine.

How do I set Excel 2007to save files as .xlsx through the MACR VBA?

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,355
Default Saving as .xlsx from VBA MACRO

I've had to use this to save as an xlsm

ThisWorkbook.SaveAs Filename:=filesavename, _
FileFormat:=52

This should help you figure out what you need.

http://www.rondebruin.nl/saveas.htm
--
HTH,
Barb Reinhardt

If this post was helpful to you, please click YES below.



"Donhuff" wrote:

I am attempting to save files through a MACRO as .xlsx files using
getclosefilename function. I have Excell 2007 set to save all files as .xls
files. When I save the files, it places the .xlsx extension, but saves in
.xls format. I cannot open the files as they are, but can after changing the
extension to .xls through Explorer they open just fine.

How do I set Excel 2007to save files as .xlsx through the MACR VBA?

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Saving as .xlsx from VBA MACRO

Actually, the VBA is part of an Excel add-in under XLSTART, and the files I'm
saving contain no code. The problem is I have Excel set to save files as
..xlsx, but Excel saves the files in Excel 97-03 format with the .xlsx
extension. I cannot open the resulting .xlsx files, but can open the files
when I manually edit the filename throgh Explorer to .xls.

I am using the following MACRO code to save the files (again, as an add-in,
not .xlsm file):

Filt = "Excel Files (*.xlsx),&*.xlsx,"

SaveFile = Application.GetSaveAsFilename(InitialFileName:=Nme , _
FileFilter:=Filt, FilterIndex:=1, Title:="Browse to Location for
File")
ActiveWorkbook.SaveAs Filename:=SaveFile _
, FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False

The code is not part of the Excel file. When it saves with the .xlsx
extension, I cannot open the file. When I manually change the extension to
..xls through Explorer, I can open the file as an earlier Excel version file.

The question is how do I get the MACRO to save the file as a Excel 2007
format.

"Barb Reinhardt" wrote:

I've had to use this to save as an xlsm

ThisWorkbook.SaveAs Filename:=filesavename, _
FileFormat:=52

This should help you figure out what you need.

http://www.rondebruin.nl/saveas.htm
--
HTH,
Barb Reinhardt

If this post was helpful to you, please click YES below.



"Donhuff" wrote:

I am attempting to save files through a MACRO as .xlsx files using
getclosefilename function. I have Excell 2007 set to save all files as .xls
files. When I save the files, it places the .xlsx extension, but saves in
.xls format. I cannot open the files as they are, but can after changing the
extension to .xls through Explorer they open just fine.

How do I set Excel 2007to save files as .xlsx through the MACR VBA?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I set default Excel Saveas file format to xlsx not xlsx Greg Conway Setting up and Configuration of Excel 1 September 17th 08 04:19 PM
Macro For Saving As .txt jshendel Excel Discussion (Misc queries) 1 August 4th 08 08:18 PM
Saving Macro whatzzup Excel Discussion (Misc queries) 2 April 24th 08 09:22 AM
Help with saving a Macro Keepsmiling1228 Excel Worksheet Functions 1 April 2nd 08 12:31 AM
saving xlsx file as xls changes currency symbols George Setting up and Configuration of Excel 0 August 6th 07 07:50 PM


All times are GMT +1. The time now is 12:42 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"