PC Review


Reply
Thread Tools Rate Thread

Cancel save dialog box

 
 
Sandy
Guest
Posts: n/a
 
      20th Jun 2008
I have the following code which works fine except that the save dialog box
pops up.
Having already saved the workbook I do not want the save box to display -
how do I prevent it?

Private Sub xxxxx()
'stuff
ThisWorkbook.Save
Application.Quit
End Sub

TIA
Sandy

 
Reply With Quote
 
 
 
 
Dennis
Guest
Posts: n/a
 
      20th Jun 2008
It should not display another message. Have you got other workbooks open than
the one you are programmatically saving ?
You can stop the message by putting this before your quit statement

Application.DisplayAlerts = False

"Sandy" wrote:

> I have the following code which works fine except that the save dialog box
> pops up.
> Having already saved the workbook I do not want the save box to display -
> how do I prevent it?
>
> Private Sub xxxxx()
> 'stuff
> ThisWorkbook.Save
> Application.Quit
> End Sub
>
> TIA
> Sandy
>
>

 
Reply With Quote
 
Sandy
Guest
Posts: n/a
 
      20th Jun 2008
Hi Dennis
There were no other books open; I was however doing a 'SaveAs' which was in
the code prior to 'ThisWorkbook.Save' so I suppose that might have had a
bearing - your suggestion works perfectly though.
Thank you.
Sandy

"Dennis" <(E-Mail Removed)> wrote in message
news:0FA6800B-3F60-4738-B2DA-(E-Mail Removed)...
> It should not display another message. Have you got other workbooks open
> than
> the one you are programmatically saving ?
> You can stop the message by putting this before your quit statement
>
> Application.DisplayAlerts = False
>
> "Sandy" wrote:
>
>> I have the following code which works fine except that the save dialog
>> box
>> pops up.
>> Having already saved the workbook I do not want the save box to display -
>> how do I prevent it?
>>
>> Private Sub xxxxx()
>> 'stuff
>> ThisWorkbook.Save
>> Application.Quit
>> End Sub
>>
>> TIA
>> Sandy
>>
>>

 
Reply With Quote
 
FSt1
Guest
Posts: n/a
 
      20th Jun 2008
hi
be sure to turn alerts back on before you exit the sub.
Application.displayalerts = true

Regards
FSt1

"Sandy" wrote:

> Hi Dennis
> There were no other books open; I was however doing a 'SaveAs' which was in
> the code prior to 'ThisWorkbook.Save' so I suppose that might have had a
> bearing - your suggestion works perfectly though.
> Thank you.
> Sandy
>
> "Dennis" <(E-Mail Removed)> wrote in message
> news:0FA6800B-3F60-4738-B2DA-(E-Mail Removed)...
> > It should not display another message. Have you got other workbooks open
> > than
> > the one you are programmatically saving ?
> > You can stop the message by putting this before your quit statement
> >
> > Application.DisplayAlerts = False
> >
> > "Sandy" wrote:
> >
> >> I have the following code which works fine except that the save dialog
> >> box
> >> pops up.
> >> Having already saved the workbook I do not want the save box to display -
> >> how do I prevent it?
> >>
> >> Private Sub xxxxx()
> >> 'stuff
> >> ThisWorkbook.Save
> >> Application.Quit
> >> End Sub
> >>
> >> TIA
> >> Sandy
> >>
> >>

 
Reply With Quote
 
Sandy
Guest
Posts: n/a
 
      20th Jun 2008
Good point!
Thanks
Sandy

"FSt1" <(E-Mail Removed)> wrote in message
news:373CA7AB-5F23-4808-A5C1-(E-Mail Removed)...
> hi
> be sure to turn alerts back on before you exit the sub.
> Application.displayalerts = true
>
> Regards
> FSt1
>
> "Sandy" wrote:
>
>> Hi Dennis
>> There were no other books open; I was however doing a 'SaveAs' which was
>> in
>> the code prior to 'ThisWorkbook.Save' so I suppose that might have had a
>> bearing - your suggestion works perfectly though.
>> Thank you.
>> Sandy
>>
>> "Dennis" <(E-Mail Removed)> wrote in message
>> news:0FA6800B-3F60-4738-B2DA-(E-Mail Removed)...
>> > It should not display another message. Have you got other workbooks
>> > open
>> > than
>> > the one you are programmatically saving ?
>> > You can stop the message by putting this before your quit statement
>> >
>> > Application.DisplayAlerts = False
>> >
>> > "Sandy" wrote:
>> >
>> >> I have the following code which works fine except that the save dialog
>> >> box
>> >> pops up.
>> >> Having already saved the workbook I do not want the save box to
>> >> display -
>> >> how do I prevent it?
>> >>
>> >> Private Sub xxxxx()
>> >> 'stuff
>> >> ThisWorkbook.Save
>> >> Application.Quit
>> >> End Sub
>> >>
>> >> TIA
>> >> Sandy
>> >>
>> >>

 
Reply With Quote
 
Dennis
Guest
Posts: n/a
 
      20th Jun 2008
Does this actually matter in this case because the next statement was
quitting the app ?
Won't they automatically be back on next time Excel is loaded ?

"FSt1" wrote:

> hi
> be sure to turn alerts back on before you exit the sub.
> Application.displayalerts = true
>
> Regards
> FSt1
>
> "Sandy" wrote:
>
> > Hi Dennis
> > There were no other books open; I was however doing a 'SaveAs' which was in
> > the code prior to 'ThisWorkbook.Save' so I suppose that might have had a
> > bearing - your suggestion works perfectly though.
> > Thank you.
> > Sandy
> >
> > "Dennis" <(E-Mail Removed)> wrote in message
> > news:0FA6800B-3F60-4738-B2DA-(E-Mail Removed)...
> > > It should not display another message. Have you got other workbooks open
> > > than
> > > the one you are programmatically saving ?
> > > You can stop the message by putting this before your quit statement
> > >
> > > Application.DisplayAlerts = False
> > >
> > > "Sandy" wrote:
> > >
> > >> I have the following code which works fine except that the save dialog
> > >> box
> > >> pops up.
> > >> Having already saved the workbook I do not want the save box to display -
> > >> how do I prevent it?
> > >>
> > >> Private Sub xxxxx()
> > >> 'stuff
> > >> ThisWorkbook.Save
> > >> Application.Quit
> > >> End Sub
> > >>
> > >> TIA
> > >> Sandy
> > >>
> > >>

 
Reply With Quote
 
FSt1
Guest
Posts: n/a
 
      20th Jun 2008
hi
maybe not. but it's been my experience that the two commands always be used
togeather regardless ie just get in the habit of turning alerts back on just
in case.

Regards
FSt1

"Dennis" wrote:

> Does this actually matter in this case because the next statement was
> quitting the app ?
> Won't they automatically be back on next time Excel is loaded ?
>
> "FSt1" wrote:
>
> > hi
> > be sure to turn alerts back on before you exit the sub.
> > Application.displayalerts = true
> >
> > Regards
> > FSt1
> >
> > "Sandy" wrote:
> >
> > > Hi Dennis
> > > There were no other books open; I was however doing a 'SaveAs' which was in
> > > the code prior to 'ThisWorkbook.Save' so I suppose that might have had a
> > > bearing - your suggestion works perfectly though.
> > > Thank you.
> > > Sandy
> > >
> > > "Dennis" <(E-Mail Removed)> wrote in message
> > > news:0FA6800B-3F60-4738-B2DA-(E-Mail Removed)...
> > > > It should not display another message. Have you got other workbooks open
> > > > than
> > > > the one you are programmatically saving ?
> > > > You can stop the message by putting this before your quit statement
> > > >
> > > > Application.DisplayAlerts = False
> > > >
> > > > "Sandy" wrote:
> > > >
> > > >> I have the following code which works fine except that the save dialog
> > > >> box
> > > >> pops up.
> > > >> Having already saved the workbook I do not want the save box to display -
> > > >> how do I prevent it?
> > > >>
> > > >> Private Sub xxxxx()
> > > >> 'stuff
> > > >> ThisWorkbook.Save
> > > >> Application.Quit
> > > >> End Sub
> > > >>
> > > >> TIA
> > > >> Sandy
> > > >>
> > > >>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Disable or hide Cancel button on Save dialog box Sandy Microsoft Excel Programming 3 20th Jun 2008 04:42 PM
bypass open/save/cancel dialog box Jon Paal Microsoft ASP .NET 5 22nd Jan 2007 09:36 PM
open/save dialog, user clicks cancel =?Utf-8?B?VGltIEpvaG5zb24=?= Microsoft Access External Data 2 5th Aug 2006 06:09 AM
download dialog box ie:OPEN-SAVE-or CANCEL is gone =?Utf-8?B?UmljaGFyZDM3MDc=?= Windows Vista General Discussion 0 17th Jul 2006 02:21 AM
Save Close Cancel Dialog Box Woes analyst@coastalcancercenter.com Microsoft Outlook 0 5th Dec 2005 06:58 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:45 AM.