View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Shelia L. Shelia L. is offline
external usenet poster
 
Posts: 1
Default Converting LOTS of xls to xlsm

What is the success rate with the Excel 2003 to 2007 macro conversions? Is
there information available somewhere on what bugs/pitfalls the conversion
process may encounter?

"Barb Reinhardt" wrote:

Here's the code.

I commented out the saveas because I'm not on Office 2007 here yet.

Option Explicit
Public Sub SaveasXLSM()

Dim FileName As String
Dim oWB As Workbook
Dim Security As MsoAutomationSecurity

Const Folder = "C:\Documents and Settings\barbara.reinhardt\Desktop"


FileName = Dir(Folder & "\*.xls")
Do While FileName < ""
Security = Application.AutomationSecurity
Application.AutomationSecurity = msoAutomationSecurityForceDisable
Set oWB = Workbooks.Open(Folder & "\" & FileName)
Application.AutomationSecurity = Security
Debug.Print oWB.Name
Debug.Print oWB.Path
newpath = oWB.Path & "\" & Replace(oWB.Name, ".xls", "xlsm")
Debug.Print newpath
'oWB.saveas newpath
oWB.Close
FileName = Dir
Loop

End Sub


--
HTH,
Barb Reinhardt



"BillCPA" wrote:

I have lots and lots of Excel 2003 workbooks with macros - almost anything I
do anymore has some kind of macro in it. And there are even more archived
files that I have to go back to every now and then.

When moving to Excel 2007, do I have to open each workbook individually and
save it as an .xlsm file, or is there some easy way to convert them all?

--
Bill @ UAMS