Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello:
I need to be able to close a file programmatically, but when I try to do so the Excel message: "Do you want to save the changes that you made to ---" With the choices "Yes", "No" and "Cancel" comes off & I would like to close the file without saving it. I would appreciate help wit the above. TIA Vinay |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Private Sub Workbook_BeforeClose(Cancel As Boolean)
ThisWorkbook.Saved = True End Sub Gord Dibben Excel MVP On 25 Dec 2004 15:23:16 -0800, wrote: Hello: I need to be able to close a file programmatically, but when I try to do so the Excel message: "Do you want to save the changes that you made to ---" With the choices "Yes", "No" and "Cancel" comes off & I would like to close the file without saving it. I would appreciate help wit the above. TIA Vinay |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You could also use one of these:
ThisWorkbook.Close SaveChanges:=False or Application.DisplayAlerts = False Regards, KL "Gord Dibben" <gorddibbATshawDOTca wrote in message ... Private Sub Workbook_BeforeClose(Cancel As Boolean) ThisWorkbook.Saved = True End Sub Gord Dibben Excel MVP On 25 Dec 2004 15:23:16 -0800, wrote: Hello: I need to be able to close a file programmatically, but when I try to do so the Excel message: "Do you want to save the changes that you made to ---" With the choices "Yes", "No" and "Cancel" comes off & I would like to close the file without saving it. I would appreciate help wit the above. TIA Vinay |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Close file without saving | Excel Programming | |||
Close file without saving | Excel Programming | |||
Programatically saving XML file as Excel spreadsheet | Excel Programming | |||
Close file without saving data | Excel Programming | |||
Programatically saving an excel .csv file to .xls file... | Excel Programming |