G
Guest
I have an XL 2002 workbook and am making changes to it. I would like to be able to have the user close the workbook without be prompted to save changes. I've tried using Application.DisplayAlerts = False and haven't been able to succeed. Is there another way to do this
Should I do something in the BeforeSave event
The code follows
Thanks
Jo
Code
m_XLApp is a reference to the application
Private Sub m_XLApp_WorkbookBeforeClose(ByVal Wb As Excel.Workbook, Cancel As Boolean
Dim vFile As Varian
m_XLApp.DisplayAlerts = Fals
If Not m_fDumpOut The
If isValidWorkbook(Wb) The
vFile = m_XLApp.GetSaveAsFilename(
InitialFileName:=Wb.Worksheets(WKS_MAIN).Range(RNG_HOSPITAL_NAME).Text,
FileFilter:=FILE_FILTER,
Title:=APP_NAME
If vFile <> False The
Wb.SaveAs FileName:=vFil
Els
Cancel = Tru
End I
End I
End I
m_XLApp.DisplayAlerts = Tru
End Sub
Should I do something in the BeforeSave event
The code follows
Thanks
Jo
Code
m_XLApp is a reference to the application
Private Sub m_XLApp_WorkbookBeforeClose(ByVal Wb As Excel.Workbook, Cancel As Boolean
Dim vFile As Varian
m_XLApp.DisplayAlerts = Fals
If Not m_fDumpOut The
If isValidWorkbook(Wb) The
vFile = m_XLApp.GetSaveAsFilename(
InitialFileName:=Wb.Worksheets(WKS_MAIN).Range(RNG_HOSPITAL_NAME).Text,
FileFilter:=FILE_FILTER,
Title:=APP_NAME
If vFile <> False The
Wb.SaveAs FileName:=vFil
Els
Cancel = Tru
End I
End I
End I
m_XLApp.DisplayAlerts = Tru
End Sub