YasserKhalil
Well-Known Member
Hello everybody
I have a workbook and I need at some point if I made changes that I don't like to run a macro that close the workbook without the prompt of saving and without saving of course
I have this code but I got error message from the application that need to close the application
I have a workbook and I need at some point if I made changes that I don't like to run a macro that close the workbook without the prompt of saving and without saving of course
I have this code but I got error message from the application that need to close the application
Code:
Sub SaveCloseReOpen()
Dim WBK As Excel.Workbook
Dim Pth As String
Set WBK = ThisWorkbook
Pth = WBK.FullName
Application.DisplayAlerts = False
Application.OnTime Now + TimeValue("00:00:05"), Application.Workbooks.Open(Pth)
WBK.Close (False)
Application.DisplayAlerts = True
End Sub