I have a macro that open all the .xls files in a folder then run a macro to do something to that files, saves and closes them as .xls. My purpose is to save the files but as .xlsx files. I've allready tryed use FileFormatNum = 51, FileFormat = 51 but none of them worked.
If someone has a better approach i appreciate the help.
Sub OpenSave()
Dim myfiles, wb As Workbook, ws As Worksheet
myfiles = Dir(ThisWorkbook.Path & "\*.xls")
Do While Len(myfiles) <> 0
Debug.Print myfiles
Set wb = Workbooks.Open(ThisWorkbook.Path & "\" & myfiles)
' Do your stuff here (edit, copy, sort etc...)
Call a Macro
If wb.Name <> ThisWorkbook.Name Then
ActiveWorkbook.Close SaveChanges:=True
Set wb = Nothing
myfiles = Dir
End If
Loop End Sub
The macro has adapted from some code i see in a site.