I am running a macro to save all Excel 97-03 files in a directory as Excel 07+
The following macro works, I was just hoping to have all files saved as lowercase .xlsx as opposed to adding on an x to the end - some of my files are in the directory as .XLS and an x added on displays .XLSx after running the macro.
Sorry if this is silly, and thanks in advance.
Sub ConvertXlsx()
Dim strPath As String
Dim strFile As String
Dim wbk As Workbook
' Path must end in trailing backslash
strPath = "C:\Users\KARASIA\Downloads\xls\"
strFile = Dir(strPath & "*.*")
Do While strFile <> ""
Set wbk = Workbooks.Open(FileName:=strPath & strFile)
wbk.SaveAs FileName:=strPath & strFile & "x", _
FileFormat:=xlOpenXMLWorkbook
wbk.Close SaveChanges:=False
strFile = Dir
Loop
End Sub
Bookmarks