PC Review


Reply
Thread Tools Rate Thread

Disable Alert

 
 
yourenotathomenow@googlemail.com
Guest
Posts: n/a
 
      6th May 2009
I've put this in my 'This Workbook' space. But it doesn't seem to be
working. Any ideas?

Private Sub Workbook_BeforeClose(Cancel As Boolean)

'Disables 'Do you want to save changes?' Alert Before Close

Application.DisplayAlerts = False

End Sub
 
Reply With Quote
 
 
 
 
Per Jessen
Guest
Posts: n/a
 
      6th May 2009
Hi

What are you trying to do ?

If you want to close the workbook without saving the workbook and no
alerts, then use the below in your "Workbook_BeforeClose" event (You
don't have to turn off the alert):

Thisworkbook.Saved=True.

Hopes this heps.

---
Per


On 6 Maj, 20:52, yourenotathome...@googlemail.com wrote:
> I've put this in my 'This Workbook' space. *But it doesn't seem to be
> working. *Any ideas?
>
> Private Sub Workbook_BeforeClose(Cancel As Boolean)
>
> 'Disables 'Do you want to save changes?' Alert Before Close
>
> * * Application.DisplayAlerts = False
>
> End Sub


 
Reply With Quote
 
yourenotathomenow@googlemail.com
Guest
Posts: n/a
 
      6th May 2009
On May 6, 8:00*pm, Per Jessen <perjesse...@hotmail.com> wrote:
> Hi
>
> What are you trying to do ?
>
> If you want to close the workbook without saving the workbook and no
> alerts, then use the below in your "Workbook_BeforeClose" event (You
> don't have to turn off the alert):
>
> Thisworkbook.Saved=True.
>
> Hopes this heps.
>
> ---
> Per
>
> On 6 Maj, 20:52, yourenotathome...@googlemail.com wrote:
>
>
>
> > I've put this in my 'This Workbook' space. *But it doesn't seem to be
> > working. *Any ideas?

>
> > Private Sub Workbook_BeforeClose(Cancel As Boolean)

>
> > 'Disables 'Do you want to save changes?' Alert Before Close

>
> > * * Application.DisplayAlerts = False

>
> > End Sub- Hide quoted text -

>
> - Show quoted text -


Thanks. It worked. Any ideas why my first try didn't work?
 
Reply With Quote
 
Howard31
Guest
Posts: n/a
 
      6th May 2009
If you want to save the workbook then put the following code:
ThisWorkbook.Save

If you don't want to save then put the following:
ThisWorkbook.Saved = True
--
A. Ch. Eirinberg


"(E-Mail Removed)" wrote:

> I've put this in my 'This Workbook' space. But it doesn't seem to be
> working. Any ideas?
>
> Private Sub Workbook_BeforeClose(Cancel As Boolean)
>
> 'Disables 'Do you want to save changes?' Alert Before Close
>
> Application.DisplayAlerts = False
>
> End Sub
>

 
Reply With Quote
 
Per Jessen
Guest
Posts: n/a
 
      6th May 2009
Hi

Excel will always prompt the user to save an unsaved file before
closing it.

Another solution to close without saving:

ThisWorkbook.Close SaveChanges:=False

Regards,
Per

>
> Thanks. *It worked. *Any ideas why my first try didn't work?-

 
Reply With Quote
 
yourenotathomenow@googlemail.com
Guest
Posts: n/a
 
      6th May 2009
On May 6, 8:37*pm, Per Jessen <perjesse...@hotmail.com> wrote:
> Hi
>
> Excel will always prompt the user to save an unsaved file before
> closing it.
>
> Another solution to close without saving:
>
> ThisWorkbook.Close SaveChanges:=False
>
> Regards,
> Per
>
>
>
>
>
> > Thanks. *It worked. *Any ideas why my first try didn't work?-- Hidequoted text -

>
> - Show quoted text -


Thanks, All.
 
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 Alert Al and Joan Windows XP Help 7 1st Nov 2007 07:39 PM
disable alert pop-ups =?Utf-8?B?c21rMjM=?= Microsoft Access VBA Modules 1 21st Sep 2006 09:11 PM
Disable the alert hurriance Microsoft Excel Programming 0 30th Jun 2006 08:59 AM
Disable Alert ITSR Thornbury USN Spyware Discussion 1 29th Mar 2005 08:46 PM
how to disable alert bonbon Microsoft Outlook 1 29th Oct 2003 12:42 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:57 PM.