Hi All,
I run a VBA code from my personal vba to open a closed workbook and then close this workbook with the code below. the issue is with all current active workbooks, when i close, there is no warning message "Do you want to save...." it's just closed without saving. until i close all current excel files and start excel again this issue will disappear. could you please help.
I run a VBA code from my personal vba to open a closed workbook and then close this workbook with the code below. the issue is with all current active workbooks, when i close, there is no warning message "Do you want to save...." it's just closed without saving. until i close all current excel files and start excel again this issue will disappear. could you please help.
VBA Code:
Application.ScreenUpdating = False
Application.DisplayAlerts = False
FileToOpen = Application.GetOpenFilename(Title:="Browse for your File & Import Range", FileFilter:="Excel Files (*.xls*),*xls*")
If FileToOpen <> False Then
Set OpenBook = Application.Workbooks.Open(FileToOpen)
OpenBook.Sheets("Sheet1").Range("G1:L62").Copy
mainWS.Range("G1").PasteSpecial xlPasteAll
OpenBook.Close False
End If
Application.ScreenUpdating = True