The goal is to have a file without any modules and if no changes are made, when closed gives no warning to save changes.
My file has a large number of modules. The last module is to save the file as a .xlsx and I understood doing so should remove all the modules. The modules are being retained until the file is closed. When closing the file a warning is rendered about saving changes.
Applicate any assistance!
Ron
My file has a large number of modules. The last module is to save the file as a .xlsx and I understood doing so should remove all the modules. The modules are being retained until the file is closed. When closing the file a warning is rendered about saving changes.
Applicate any assistance!
Ron
VBA Code:
Sub SaveFinalasXLSX_m()
' properties name = SaveFinalasXLSX
With Application
.DisplayAlerts = False
.ScreenUpdating = True
.DisplayStatusBar = True
.Calculation = xlManual
.OnTime Now + TimeSerial(0, 0, 0.1), "m_ClearStatusBar"
.StatusBar = "Saving as a regular Excel file."
.OnTime Now + TimeSerial(0, 0, 10), "m_ClearStatusBar"
.ScreenUpdating = False
End With 'Application
'
Dim WbPath As String
Dim varPath As String
Dim fPath As String
Dim FileP As String 'file path entered into Range("FinalSave") on the [Start] worksheet.
Dim ThisWb As Workbook
'
Set ThisWb = ActiveWorkbook
With ThisWb
'
varPath = ThisWorkbook.Path
fPath = Replace(varPath, "\", "/") & "/Temp/"
WbPath = ThisWorkbook.Path
'
FileP = Range("FinalSave")
ThisWb.SaveAs FileP & "AD_Listing_" & Format(Now, "mm-dd-yyyy hmmAM/PM") & ".xlsx", FileFormat:=51
'
With Application
.DisplayAlerts = False
.ScreenUpdating = True
.DisplayStatusBar = True
.Calculation = xlManual
.OnTime Now + TimeSerial(0, 0, 0.1), "m_ClearStatusBar"
.StatusBar = "Completed saving as a regular Excel file."
.OnTime Now + TimeSerial(0, 0, 10), "m_ClearStatusBar"
.ScreenUpdating = False
End With 'Application
End With 'ThisWb
End Sub