Email:      Pass:    Pass?
Close Window   
Free Ebook
Get Your Free Excel
Our Top 15 Excel Tutorials
Instant Access!
Subscribe for Free Excel tips & more!

Convert Xl2003 Files To Xl2007 With Same Property Information

Forum Register
Search Excel Forum Posts, Tutorials, Macros, Tips, and More

Hi everyone,

I have been working for years with the .xls extension and have almost completely transitionsed to the .xlsx extension. The good thing is that the new extension takes up less space than the older version but I still have a lot of files in xls. I am wondering if anyone has come across a way to convert all the xls to xlsx files in a directory but while maintaining the original properties (e.g. when it was originally created, last time modified, etc.).



View Answers     

Similar Excel Tutorials

Remove Personal Information from Excel Files
How to remove all personally identifiable information from an Excel file. When a file is created in Excel, it auto ...
Rename a Module for an Excel Macro
This Excel tip shows you how to rename a module in Excel. This is a very important thing to do when you have a larg ...
Convert Numbers Stored as Text to Numbers in Excel
I'll show you 4 ways to convert numbers stored as text to numbers in Excel.  This situation often happens when you ...
Export an Excel File to a CSV File
How to export an Excel file to a CSV file (comma separated values file).  This allows you to turn any Excel spread ...

Helpful Excel Macros

Save the Current Worksheet as a New Excel Workbook File
- This Excel Macro will save the currently visible/active worksheet (the one that you see when you run the macro) to a
Output the Name of the Current Excel Workbook Including Extension - UDF
- Free Excel UDF to display the name of the current Excel workbook, including the workbook extension. This function has n
Excel Macro to Save a Specific Worksheet as a New File
- This Excel Macro allows you to save a specific worksheet within the Excel Workbook to its own new file. You will be a
Output the Name of the Current Excel Workbook Without the File Extension - UDF
- Free Excel UDF that displays the name of the Excel workbook without its extension. This is a great UDF (user defined fu
Save the Current Worksheet as a New File in the Current Folder
- This Excel Macro saves the currently visible worksheet into the SAME folder as the current file. It is different from

Similar Topics

Hi all,

I've recently upgraded my Office from 2003 to 2010. I have a drive which contains many folders and many files. All files in the folders are in .xls format and does not contain macros.

Usually, I convert a Excel 2003 .xls file by going to File > Info > Convert, but that I've to do it one by one.

I've about 100+ .xls files in my drive. Does anyone know how to mass convert the .xls files to .xlsx files?

I think I can't just change to file extension from .xls to .xlsx as I couldn't open the .xlsx file anymore.

Hello Everyone,

I have a large number of .txt files that are comma separated files (but not saved with the .csv extension) that I need to convert to files with the .csv extension.

Is there an easy way to do this for all files in a given folder? Ideally, the files don't even need to be opened as they are are quite large in size (70MB+) and there are a lot of them (500+).

Any code snippets would be greatfully received.

Many thanks for your time,

We are having a problem reopening saved XLSX (as well as DOCX) files.

If a legacy XLSX file (probably from Excel 2009 for Mac) is opened in Excel 2011 for Mac, modified, then saved, it become un-openable.

Error message is:
"Excel cannot open this file. The file format or file extension is not valid. Verify that the file has not been corrupted and that the file extension matches the format of the file"

Since the filename nor extension has been changed, the only source of "corruption" is Excel 2011 itself.

Note that saving to an even older legacy format XLS does allow the file to be reopened.

Has anyone had this problem AND found a solution?

Hi! Just got registered by this forum. My problem is (I don’t know if it is really problem) all the excel files in my computer show the .xls extension and I never noticed this before only right now. Is there something wrong with my computer because not only the excel files show the extension also word document. Every time I save a file it will automatically has an extension even if I delete the extension after I click save the extension will still appears.

Normally when I saved files I don’t see any extension in the file when it's in the folder.
Any help will be greatly appreciated.

see attached image.

I am using ms office 2000 pro. I'm receiving files with with excel.xlsx
extension and can not open them. Help would be greatly appreciated

Hi Everyone,
I've recently been using a database for downloading vast amounts of stock data at work. The stupid thing is that on the database station, there's only Excel 2003 so the xls files take up tons of space. After I save them in xls, I have to go to a different computer and convert (save) each file in the xlsx format to save up space and make opening/closing/working with the files faster. I have to this once, sometimes twice daily. My question is: is there a way to select all (for example 20 files) at once and convert them to xlsx or I have to do it manually for each one. Thanks for your help!

I need to look at all files in a specific directory and see which of the files have a "DateLastModified" value which is equal to the current date. I then need to set a flag of some sort to let me know which files met the criteria so I know which files to look at. I know how to get the last modified date, but need help building the loop and setting the flag. I basically want to set a Y/N or T/F flag using a variable based on the file name, minus the extension. All of the files in the directory will be Excel files.

How would I write an excel macro to change all files in the same directory with a .xls extension to an .xlsx extension?


I have a user on our network who has created an excel file on a network share. She has started noticing that when she is updating it, it is creating these sort of backup files. They are not backup files I am used to seeing i.e. the hidden microsoft backup files that start with a ~

I originally thought they had nothing to do with excel. The reason for this being that say the original file was called MyExcelFile.xls the backup file is totally random i.e. 0DC81000 with no file extension. I assumed that because it has no file extension that it would not open, without first asking you which program I would like to use. However it opens up in excel and it is what looks like a backup of the original file.

This user does not have permissions to view hidden files or folders so I dont know why these are being saved. The strange thing is that it only seems to happen to users on that specific server, it does not happen on any of our other servers.

Does anyone have any ideas???

I have some lotus spreadsheet files with extension .WR1. These files were created in early 80's possible using Lotus 123. I need to open & read these files. Can somebody convert these files to excel or suggest software to buy.

Many Thanks!


I have to download files from a database and save them in .xls format (the only format permitted to export from the database)

Anyone have a macro to:

Given an open excel wb saved to my hard drive (or network drive) in non .xlsx format. (most likely .xls)

Switch the file to .xlsx format without loosing the open file. (re-open ok).

-Don't want two files
-Dnn't want to have the file name changed (except for the extension).
-Don't want to remain in compatibility mode.
-Don't want to wait a long time.
-Don't want to have possibility of file corruption.

I just want to take my non .xlsx file and then, turn into a .xlsx file. (if I save the file as .xlsx I am still in compatibility mode until I re-open the file. I also will have two files---very annoying).

Thanks in advance

I've got a macro that I've pieced together from different sources on the web designed to combine a lot of excel workbooks with single worksheets into one workbook with many worksheets. My problem is, the extension used in the VBA is .xls, causing me to have to go in manually each time the extension is something else, say, .xlsx, and change the code before I can put the files together.

Does anyone know how to make this tweak so that I can have multiple file extensions automatically checked? Maybe even a list of them could be added to the first sheet under Accepted File Extensions so that someone else who was using it could add theirs if it wasn't already in the list without having to open up the VB editor?

I've attached the file. Thanks


It doesn't seem to work at all when I go from .xls to .xlsx, although .dat and .rep both work. Not sure what causes this either.

Using Excel 2007:
I am trying to use dir() in a While...wend to get a specific list of files to process, but I want the list to only include those with a .xls extension, not those ending in .xlsx. It seems that the file filter ".xls" doesn't exclude those files with a ".xlsx" extension.
Sample code demonstrating the problem (will show the problem if there is at least one cycle that meets a*.xls and one that meets a*.xlsx).
Is there a workaround to this at the dir() level? Or do I need to go ahead and open the file and test its contents?

Sub TestDir()
    On Error GoTo Nofile   'trap cancel, X-out of the dialog, etc.
    With Application.FileDialog(msoFileDialogOpen)
        .AllowMultiSelect = False
        .InitialFileName = "a*.xls"
        GetDir = .SelectedItems(1)
    End With
    On Error GoTo 0       'reset error handler
    If GetDir  "False" Then
        Path = CurDir & "\"
        MsgBox "Directory not selected"
        Exit Sub
    End If
    df = Dir(Path & "a*.xls") 'should get the list of a*.xls files in the directory, but gets a*.xlsx too
    While df  ""
        MsgBox (df)
    df = Dir()
    GoTo OK     'skip the error message
    MsgBox ("No file selected.  Macro will exit.")
    Exit Sub

End Sub

Thanks for any help,

I have just received an eMail from my accountant and here file name extension is .xlsx

I have never seen this before. Can someone tell me why the x on the end of the extension?

Also, when it opens, a Message Box is displayed: File Conversion in process.

I have a few files sent out to field users. These users, for some reason, really love to change my .xlsm excel files to .xlsx when they save. Is there any VBA code that will help with this? The closest I could come up with is using the BeforeSave workbook event, but this still allows the user to make any changes they want to extension once the Save As dialog box appears.

Example of what I want:

User clicks save as, types in a new file name and selects .xls
Macro assigns the previous file extension to the file then saves it.

Very new to all this VBA programming. I need help modifying Ken Puls "Count Files in a directory (All file types or one specific type only, using FileSearch)" I would like the script to except a wild card expression of a file type (ie.*-ps.sid this would return all the files with -ps at the end of the .sid extention)

Thank You in advance: Sydney Wood

Option Compare Text
Option Explicit

Function CountFiles(Directory As String, Optional Ext As String = "All") As Double
'Function purpose: To count all the files in a directory
'Alternate purpose: To count all files in a directory with a specified file extension

'Method: If a file extension is supplied as an arguement, we can cut down on the list
' of files to filter through by calling only files that are in the same
' msoFileType group. (ie .doc and .dot files belong to the WordDocuments
' group, but not the ExcelWorkbooks group. This will allow us to count the
' number of files matching the extension more quickly, since we will only
' operate on files that belong to that group, not all groups. If no file
' extension is supplied (or the file does not belong to any specified group,)
' we can still resort to counting all files.


Dim fs As Object, i As Integer

'Create the FileSearch object
Set fs = Application.FileSearch

'If an empty string has been passed as the file extension, set it to "All"
If Len(Ext) < 3 Then Ext = "All"

With fs
'Set the directory to look in to the directory arguement supplied by the user
.LookIn = Directory
'Determine the msoFileType group that the file extension belongs to.
.FileType = GetMSOFileType(Ext)
'Execute the search

If Ext = "All" Then
'If no file extension supplied, count all files in the directory
CountFiles = .FoundFiles.Count
'If a file extension is supplied count the number of files in the
'filtered list which match the supplied extension
For i = 1 To .FoundFiles.Count
If Right(.FoundFiles.Item(i), 3) = Right(Ext, 3) Then _
CountFiles = CountFiles + 1
Next i
End If
End With

'Release the FileSearch object
Set fs = Nothing

End Function

Function GetMSOFileType(FileExt As String) As Double
'Function purpose: To determine the msoFileType of a file extension
'Note: If a file extension does not exist in the list, the file type will default
' to AllFiles. More msoFileTypes can be found by looking up the "FileType Property"
' in the VBA help, or on Sheet2 of the example workbook

Select Case Right(FileExt, 3)
Case Is = "doc", "dot"
'Assign file type of msoFileTypeWordDocuments
'NOTE: msoFileTypeWordDocuments does not include "rtf" files
GetMSOFileType = 3
Case Is = "xls", "xla", "xlt", "xlc", "xlm"
'Assign file type of msoFileTypeExcelWorkbooks
'NOTE: msoFileTypeExcelWorkbooks does not include "xll" or "xlw" files
GetMSOFileType = 4
Case Is = "ppt", "pps", "pot"
'Assign file type of msoFileTypePowerPointPresentations
GetMSOFileType = 5
Case Is = "mdb", "mde", "ade", "adp"
'Assign file type of msoFileTypeDatabases
'NOTE: msoFileTypeDatabases does not include "mda" files
GetMSOFileType = 7
Case Is = "pub"
'If XL2002 or later, assign file type of msoFileTypePublisherFiles
'otherwise, assign file type of msoFileTypeAllFiles
If Val(Application.Version) < 10 Then
GetMSOFileType = 1
GetMSOFileType = 18
End If
Case Is = "vsd", "vss", "vst"
'If XL2002 or later, assign file type of msoFileTypeVisioFiles
'otherwise, assign file type of msoFileTypeAllFiles
'NOTE: msoFileTypeVisioFiles does not include "vsw", "vdx", "vsx" or "vtx" files
If Val(Application.Version) < 10 Then
GetMSOFileType = 1
GetMSOFileType = 21
End If
Case Is = "htm", "tml", "mht"
'If XL2002 or later, assign file type of msoFileTypeWebPages
'otherwise, assign file type of msoFileTypeAllFiles
If Val(Application.Version) < 10 Then
GetMSOFileType = 1
GetMSOFileType = 23
End If
Case Else
'Assign file type of msoFileTypeAllFiles
GetMSOFileType = 1
End Select

End Function

Good morning everyone.

A co-worker of mine is having a problem opening his Excel files that I can't figure out, and I was wondering if any of you had any suggestions on what could be causing it. He is running Excel 2003.

When he tries to open files by "double-clicking" them, they begin to open normally, and for a brief couple seconds you can see the filename with the ".xls" file extension in the blue bar at the top of the window like normal, but then the ".xls" file extension disappears and it immediately changes to a number "1". The filename is still there, but it is followed by a "1" instead of the ".xls" file extension, and it prevents him from saving the file. If he tries to save it he must use "save-as". These are files he works with on a daily basis so the permissions have been set to allow him full control since they were created. The strange thing is that if he opens the same file by "right-clicking" and then clicking "open" from the sub-menu, it works fine? It only replaces the ".xls" with a "1" when he opens it by "double-clicking" the file.

I would be grateful for any input you may have. Thanks in advance and have a great day!

Best regards,

I have a directory of files that I want to import into Access. However, Access does not seem to recognize the extension. I seem to remember a way to get around that, but it involved going into the registry and adding the file extension.....any thoughts?

I have many files with macros that reference other excel files and now that I have been converted to Office 2007, the extensions are changing.

Is there away to call another file w/o having the specifically reference .xls, .xlsx, or .xlsm so that it will access the file no matter the specific excel extension?

I have an excel file that is distributed within my organization. That file contains certain worksheets that the end-users do not need to see or make changes to, so in the VBA project, I change those files to "VeryHidden". Then I protect the workbook's VBA code by going to Tools->VBAProject- Project Properties-> Protection tab and adding a password. This worked great as it allowed all the other sheets to function as intended, but didn't allow the users to access the sheets that were hidden.

However, we recently upgraded to Excel 2007, and the password protection is stripped whenever the file is saved with the extension .xlsx. I can save it as a "macro-enabled" file with the extension .xlsm, but all that needs to be done to remove the password is to save it with the .xlsx extension again. Is there something that can be done in Excel 2007 to protect VBA code, or am I doing something completely wrong?

This is my first post here, so please let me know if I've done something wrong!

Our company has just had all its PCs upgraded and we've moved to Vista and Excel 2007.

I have loads of files in .xls that I'd like to convert to .xlsx. Is there any way to convert them en masse without going into each one and doing them individually?


some of the files have macros embedded, so it would be useful if they could be converted to .xlsm at the same time



Hi Guys,
I have a question regarding Access 2007. I have created a code to transfer data from excel to Access both versions in 2007. I have done it the same as in a book I am reading. However when I create a access data file in Access 2007 with .accdb extension and like to access that database and run the vba an error file extension not reconised comes up.

So I need to save it in the older version with .mdb extension.
Can someone explain how I am able to use the newer extension?

Many Thanks


I need to convert 500+ xls spreadsheet files to tab-separated text
files. How can I automate this process? I am VB illiterate, though
I'm handy with Perl, so if there's a way to convert an xls file to
tsv on the command line I could use Perl to automate this. Anyway,
any advice appreciated.


Sent from a spam-bucket account; I check it once in a blue moon. If
you still want to e-mail me, cut out the extension from my address,
and make the obvious substitutions on what's left.

I am working in vba and trying to add a custom extension to my files being saved (*.medcl)

This isn't working for me
Set fd = Application.FileDialog(msoFileDialogSaveAs)

With fd
.Filters.Add "Bailout", "*.medcl"

Doesn't apparantly work in msoFileDialogSaveAs in the same fashion it does in msoFileDialogOpen .

Are there ".Filters.Clear" and ".Filters.Add" equivelants to create a custom file extension and restrict the file extension options in the save as dialog box to that extension?

Thanks for any help


I have been looking round and have come back to you guys to give me some advice, I am looking for a way to bulk convert a number of xls files to xlsx format, as i have noticed that xlsx files are around 3 times smaller than xls files.
I am thinking that some sort of macro which file by file opens the file, saves it as an xlsx (2010) file and then deletes the original.

I know that a number of my files are quite small but there are a number which are around 100mb, and these very quickly add up to many Gb.

If anyone can help or point me in the right direction i would be really greatful