Hi,
I want code to run on all open workbooks following is the code I wrote but it does work properly
any help will be appreciated.
Sub SAVEasXLSB()
Application.ScreenUpdating = False
Dim wbkX As Workbook
Dim fpath As String
Dim wname As String
Set wbkX = ActiveWorkbook
'wname = ActiveWorkbook.Name
wname = Left(ActiveWorkbook.Name, (InStrRev(ActiveWorkbook.Name, ".", -1, vbTextCompare) - 1))
fpath = ActiveWorkbook.path & "\" & wname
For Each wbkX In Application.Workbooks
'With wbkX
ActiveWorkbook.SAVEas filename:=fpath & ".xlsb", FileFormat:= _
xlExcel12, CreateBackup:=False
ActiveWorkbook.Close
'End With
Next wbkX
Application.ScreenUpdating = True
End Sub
Display More
i have attached the sample files for your reference.
Thanks in advance