I used a macro in the past to convert 500 .xls (Excel 2 format) files to .xlsb (binary format.) I was not the author of the macro, and I would like to tweak it to now convert .xlsx files to .xlsb. What you see below contains an error that results in the converted files having an ".xlsxb" extension. Specifically, this is the incorrect code: wkbkTemp.SaveAs vFileArray(i) & "b", FileFormat:=xlExcel12
Dim vFileArray As Variant
Dim wkbkTemp As Workbook
Application.DisplayAlerts = False
vFileArray = Application.GetOpenFilename(MultiSelect:=True)
If IsArray(vFileArray) Then
For i = LBound(vFileArray) To UBound(vFileArray)
If Right(vFileArray(i), 5) = ".xlsx" Then
Set wkbkTemp = Workbooks.Open(vFileArray(i))
wkbkTemp.SaveAs vFileArray(i) & "b", FileFormat:=xlExcel12
wkbkTemp.Close False
Else
MsgBox "This file: " & Chr(10) & vFileArray(i) & Chr(10) & "will not be processed."
End If
Next i
End If
End Sub
Dim vFileArray As Variant
Dim wkbkTemp As Workbook
Application.DisplayAlerts = False
vFileArray = Application.GetOpenFilename(MultiSelect:=True)
If IsArray(vFileArray) Then
For i = LBound(vFileArray) To UBound(vFileArray)
If Right(vFileArray(i), 5) = ".xlsx" Then
Set wkbkTemp = Workbooks.Open(vFileArray(i))
wkbkTemp.SaveAs vFileArray(i) & "b", FileFormat:=xlExcel12
wkbkTemp.Close False
Else
MsgBox "This file: " & Chr(10) & vFileArray(i) & Chr(10) & "will not be processed."
End If
Next i
End If
End Sub