Page tree

Welcome to FreeSoftwareServers Confluence Wiki

Skip to end of metadata
Go to start of metadata
Public Sub ExcelWBFormatCheck(wb As Workbook)
Dim WbName As String
WbName = Environ("USERPROFILE") & "\Downloads\" & ActiveWorkbook.Name & "x"
If wb.FileFormat <> xlOpenXMLWorkbook Then
   On Error Resume Next
   wb.SaveAs FileFormat:=xlOpenXMLWorkbook, Filename:=WbName
   Debug.Print Application.ActiveWorkbook.FullName
   MsgBox "Your Workbook will be upgraded to `xlsx` format and saved to " & WbName
   ActiveWorkbook.Close SaveChanges:=False
   Workbooks.Open (WbName)
   Application.Wait (Now() + TimeValue("00:00:01"))
   Application.ScreenUpdating = True
   ActiveWindow.SmallScroll down:=1
   ActiveWindow.SmallScroll up:=1
End If
End Sub
  • No labels