Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default 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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default 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




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default 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






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default 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








  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default 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










  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default 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










Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to save and close, then copy file NewSysAdmin Excel Discussion (Misc queries) 2 December 2nd 09 03:24 PM
File close excel does not ask me to save changes Cathy Humphreys Excel Discussion (Misc queries) 2 June 13th 05 08:48 PM
I can't save a file unless I close all excel instances or it's th. BVBOWES Excel Discussion (Misc queries) 0 April 26th 05 09:20 PM
Close file without Save Changes dialog box flumpf Excel Programming 1 October 24th 03 02:38 AM
Automate open file, update links, run macro, close and save file Geoff[_7_] Excel Programming 2 August 26th 03 10:13 PM


All times are GMT +1. The time now is 08:14 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"