ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   App Close and File No Save (https://www.excelbanter.com/excel-programming/287134-app-close-file-no-save.html)

Michael Kintner

App Close and File No Save
 
How can in VB say: Close Application and Don't Save File?

--
Thank you for your help in advance!!! (smile)

Mike



Ron de Bruin

App Close and File No Save
 
Hi

ActiveWorkbook.Saved = True
Application.Quit

Try this

--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)
www.rondebruin.nl



"Michael Kintner" wrote in message ...
How can in VB say: Close Application and Don't Save File?

--
Thank you for your help in advance!!! (smile)

Mike





Mark D'Agosta

App Close and File No Save
 
Ron,

I have found that this generally works to suppress the save warning that
Excel generates when trying to close an unsaved sheet. I now have a
situation where I want to delete an existing worksheet (from within my
Add-In code), as follows:

ActiveWorkbook.Saved = True
ActiveWorkbook.Sheets("MySheet").Delete

However, I have been unable to suppress the "Data may exist in the sheet(s)
selected for deletion. To permanently delete the data, press Delete."
warning message. I can't find anything in the knowledge base about this
message. Any idea on how to suppress it? I don't want the user to even
know that I'm deleting, and replacing, a worksheet.

Thanks.

Mark D'Agosta



"Ron de Bruin" wrote in message
...
Hi

ActiveWorkbook.Saved = True
Application.Quit

Try this

--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)
www.rondebruin.nl



"Michael Kintner" wrote in message

...
How can in VB say: Close Application and Don't Save File?

--
Thank you for your help in advance!!! (smile)

Mike







Michael Kintner[_3_]

App Close and File No Save
 
Yeap, got that one figured out.

Use:
Application.DisplayAlerts = False
' delete the sheet
Application.DisplayAlerts = True

Mike



"Mark D'Agosta" wrote in message
et...
Ron,

I have found that this generally works to suppress the save warning that
Excel generates when trying to close an unsaved sheet. I now have a
situation where I want to delete an existing worksheet (from within my
Add-In code), as follows:

ActiveWorkbook.Saved = True
ActiveWorkbook.Sheets("MySheet").Delete

However, I have been unable to suppress the "Data may exist in the

sheet(s)
selected for deletion. To permanently delete the data, press Delete."
warning message. I can't find anything in the knowledge base about this
message. Any idea on how to suppress it? I don't want the user to even
know that I'm deleting, and replacing, a worksheet.

Thanks.

Mark D'Agosta



"Ron de Bruin" wrote in message
...
Hi

ActiveWorkbook.Saved = True
Application.Quit

Try this

--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)
www.rondebruin.nl



"Michael Kintner" wrote in message

...
How can in VB say: Close Application and Don't Save File?

--
Thank you for your help in advance!!! (smile)

Mike









Michael Kintner[_3_]

App Close and File No Save
 
Yeap, got that one figured out.

Use:
Application.DisplayAlerts = False
' delete the sheet
Application.DisplayAlerts = True

Mike

"Mark D'Agosta" wrote in message
et...
Ron,

I have found that this generally works to suppress the save warning that
Excel generates when trying to close an unsaved sheet. I now have a
situation where I want to delete an existing worksheet (from within my
Add-In code), as follows:

ActiveWorkbook.Saved = True
ActiveWorkbook.Sheets("MySheet").Delete

However, I have been unable to suppress the "Data may exist in the

sheet(s)
selected for deletion. To permanently delete the data, press Delete."
warning message. I can't find anything in the knowledge base about this
message. Any idea on how to suppress it? I don't want the user to even
know that I'm deleting, and replacing, a worksheet.

Thanks.

Mark D'Agosta



"Ron de Bruin" wrote in message
...
Hi

ActiveWorkbook.Saved = True
Application.Quit

Try this

--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)
www.rondebruin.nl



"Michael Kintner" wrote in message

...
How can in VB say: Close Application and Don't Save File?

--
Thank you for your help in advance!!! (smile)

Mike









Mark D'Agosta

App Close and File No Save
 
Thanks Mike. That did the trick.

Mark

"Michael Kintner" wrote in message
...
Yeap, got that one figured out.

Use:
Application.DisplayAlerts = False
' delete the sheet
Application.DisplayAlerts = True

Mike



"Mark D'Agosta" wrote in message
et...
Ron,

I have found that this generally works to suppress the save warning that
Excel generates when trying to close an unsaved sheet. I now have a
situation where I want to delete an existing worksheet (from within my
Add-In code), as follows:

ActiveWorkbook.Saved = True
ActiveWorkbook.Sheets("MySheet").Delete

However, I have been unable to suppress the "Data may exist in the

sheet(s)
selected for deletion. To permanently delete the data, press Delete."
warning message. I can't find anything in the knowledge base about this
message. Any idea on how to suppress it? I don't want the user to even
know that I'm deleting, and replacing, a worksheet.

Thanks.

Mark D'Agosta



"Ron de Bruin" wrote in message
...
Hi

ActiveWorkbook.Saved = True
Application.Quit

Try this

--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)
www.rondebruin.nl



"Michael Kintner" wrote in message

...
How can in VB say: Close Application and Don't Save File?

--
Thank you for your help in advance!!! (smile)

Mike












All times are GMT +1. The time now is 10:33 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com