Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Disable Alert

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

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, 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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Disable Alert

On May 6, 8:00*pm, Per Jessen 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, 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?
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 100
Default Disable Alert

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


" 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

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 703
Default Disable Alert

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?-



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Disable Alert

On May 6, 8:37*pm, Per Jessen 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?-- Hide quoted text -


- Show quoted text -


Thanks, All.
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
Disable Macro Alert [email protected] Excel Discussion (Misc queries) 2 September 2nd 11 08:49 PM
Can you disable the macro security alert? Elceller in distress[_2_] Excel Programming 4 August 1st 06 10:36 PM
Disable the alert hurriance[_9_] Excel Programming 0 June 30th 06 08:59 AM
Disable Link Alert Otto Moehrbach Excel Programming 1 June 14th 06 10:15 PM
Disable alert message when merging cells?? yung Excel Programming 1 March 10th 05 02:57 AM


All times are GMT +1. The time now is 02:00 AM.

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"