xlFileFormat

LadyDi

Registered User.
Local time
Today, 08:49
Joined
Mar 29, 2007
Messages
894
I currently have a spreadsheet that is saved as a .xlsb file format. In that spreadsheet, I have a module that will export certain information into another spreadsheet to be used by another department. When the file is exported, the new file format is .xls. I know I need to change the xlFileFormat to correct this problem, but I don't know what to change it to. I am currently using Office 2007, and the other department is using Office 2010. If I change it to xlNormal, it still exports the file in .xls format. If I change it to xlExcel12, it exports the file to .xlsb (which I've heard that Office 2010 does not like). How can I force this export to generate a .xlsx file? The code that I currently have looks like this:
wkbk1.SaveAs ("C:\Report_Data\Accounts\Reports\" & [ACCOUNT_UNDERSCORE_NAME00] & "_WOW_ATMs_" & Format([DD1_END_DATE1_0], "mmddyy")) _
, FileFormat:=xlExcel12, CreateBackup:=False
 
Hi, LadyDi,

maybe you should have a look at the options for saving on your computer (maybe still be put to *.xls).

Use VBA SaveAs in Excel 2007-2010 by Ron de Bruin is showing things up.

The FileFormat should be xlOpenXMLWorkbook and the FileFormatNum 51:

Code:
wkbk1.SaveAs ("C:\Report_Data\Accounts\Reports\" & [ACCOUNT_UNDERSCORE_NAME00] & "_WOW_ATMs_" & Format([DD1_END_DATE1_0], "mmddyy")), _
    FileFormat:=xlOpenXMLWorkbook, _
    CreateBackup:=False
where I´d prefered to have the date in yyddmm instead of mmddyy (that´s my 'feeling for storing files).

Ciao,
Holger
 
That works perfectly. Thank you very much.
 

Users who are viewing this thread

Back
Top Bottom