Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default How can I batch convert 97-2003 .xls files to 2007 .xlsx files

I have a lot to do, so it would be nice to batch them up!
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,441
Default How can I batch convert 97-2003 .xls files to 2007 .xlsx files

Dave,

You could run a macro, below. Change the path to where you have the files stored. With Excel 2007,
you have a few options - I'm showing how to save files that may have macros or other code...

HTH,
Bernie Deitrick
MS Excel MVP

Sub TrandformAllXLSFilesToXLSM()

Dim myPath As String

myPath = "C:\Excel\"
WorkFile = Dir(myPath & "*.xls")

Do While WorkFile < ""
If Right(WorkFile, 4) < "xlsm" Then
Workbooks.Open FileName:=myPath & WorkFile
ActiveWorkbook.SaveAs FileName:= _
myPath & WorkFile & "m", FileFormat:= _
xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False
ActiveWorkbook.Close
End If
WorkFile = Dir()
Loop
End Sub

"Dave Nuttall" wrote in message
...
I have a lot to do, so it would be nice to batch them up!



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,718
Default How can I batch convert 97-2003 .xls files to 2007 .xlsx files

I would just add that if any of those workbooks had macros the files have to
get the XLSM extension or Excel will refuse to run them.

--
Jim
"Bernie Deitrick" <deitbe @ consumer dot org wrote in message
...
| Dave,
|
| You could run a macro, below. Change the path to where you have the files
stored. With Excel 2007,
| you have a few options - I'm showing how to save files that may have
macros or other code...
|
| HTH,
| Bernie Deitrick
| MS Excel MVP
|
| Sub TrandformAllXLSFilesToXLSM()
|
| Dim myPath As String
|
| myPath = "C:\Excel\"
| WorkFile = Dir(myPath & "*.xls")
|
| Do While WorkFile < ""
| If Right(WorkFile, 4) < "xlsm" Then
| Workbooks.Open FileName:=myPath & WorkFile
| ActiveWorkbook.SaveAs FileName:= _
| myPath & WorkFile & "m", FileFormat:= _
| xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False
| ActiveWorkbook.Close
| End If
| WorkFile = Dir()
| Loop
| End Sub
|
| "Dave Nuttall" wrote in message
| ...
| I have a lot to do, so it would be nice to batch them up!
|
|


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default How can I batch convert 97-2003 .xls files to 2007 .xlsx files


You could run a macro, below.


Thanks Bernie! In my naivety I had supposed that MS would have supplied a
way to do this (other than one at a time), but had forgotten to tell anyone
about it.
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default How can I batch convert 97-2003 .xls files to 2007 .xlsx files

Thanks, Bernie. Would like to point you et al. to this:

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

It mentions the importance of specifying the sub-format with Excel 2007
since it has about 10 million to choose from just to make life interesting.

By the way, does anyone know if there is any kind of share/freeware utility
that will do these conversions faster than some VBA-powered macro? The
reason we want to do it here at our office is because the 2007 formatted docs
are so much smaller than the earlier versions and we are running low on file
server space.

"Bernie Deitrick" wrote:

Dave,

You could run a macro, below. Change the path to where you have the files stored. With Excel 2007,
you have a few options - I'm showing how to save files that may have macros or other code...

HTH,
Bernie Deitrick
MS Excel MVP

Sub TrandformAllXLSFilesToXLSM()

Dim myPath As String

myPath = "C:\Excel\"
WorkFile = Dir(myPath & "*.xls")

Do While WorkFile < ""
If Right(WorkFile, 4) < "xlsm" Then
Workbooks.Open FileName:=myPath & WorkFile
ActiveWorkbook.SaveAs FileName:= _
myPath & WorkFile & "m", FileFormat:= _
xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False
ActiveWorkbook.Close
End If
WorkFile = Dir()
Loop
End Sub

"Dave Nuttall" wrote in message
...
I have a lot to do, so it would be nice to batch them up!




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 can I batch convert old excel 95/97/200/xp files to excel2003 LarryG Excel Discussion (Misc queries) 2 August 13th 09 08:43 PM
Excel 2007 xlsx files open as Read-Only in Excel 2003 after Compat Tim Excel Discussion (Misc queries) 1 March 31st 07 11:12 AM
converter tool to convert XL 2007 files to XL 2003 files Dave F Excel Discussion (Misc queries) 6 December 15th 06 12:45 AM
HOW DO I CONVERT XLSX FILES BACK TO EXCEL 2003? vei Excel Discussion (Misc queries) 5 July 10th 06 09:28 PM
modify xlsx files with excel 2003 mallorypr Excel Discussion (Misc queries) 0 July 10th 06 03:15 PM


All times are GMT +1. The time now is 01:46 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"