Sub ChangeFileFormat()
Dim Folder As String, FileName As String
Dim wb As Workbook
Folder = "C:\MyFolder\"
FileName = Dir(Folder & "*.xlsm", vbNormal)
On Error GoTo exitsub
With Application
.EnableEvents = False: .ScreenUpdating = False
End With
Do While FileName <> ""
Set wb = Workbooks.Open(Folder & FileName)
FileName = Replace(FileName, ".xlsm", ".xls")
If FileName <> ThisWorkbook.Name Then
wb.SaveAs FileName:=Folder & FileName, FileFormat:= _
xlExcel8, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
End If
wb.Close False
FileName = Dir
Set wb = Nothing
Loop
exitsub:
With Application
.EnableEvents = True: .ScreenUpdating = True
End With
If Err > 0 Then MsgBox (Error(Err)), 48, "error"
End Sub