Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Application.Displayalerts = value (is not working for me)

Hi there,

I have some macro code that iniates upon workbook open below:
-------------------------------------------------------------------
Sub workbook_open()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
ws.Visible = xlSheetVisible
Next ws
Worksheets("Error").Visible = xlVeryHidden
Application.Sheets("Sheet1").Select
If Now = Worksheets("Error").Range("AO241") Then
Confirm = MsgBox("This workbook has expired. Please contact support
for further assistance.", vbInformation + vbOKOnly, "Workbook Expiry")
If Confirm = vbOKOnly Then
Application.DisplayAlerts = False
Application.Quit
Else:
Application.DisplayAlerts = False
Application.Quit
End If
Else:
Application.DisplayAlerts = False
End If
End Sub
-------------------------------------------------------------------

As you may notice from my many frustrating attempts (ie:
Application.Displayalerts = False), I am trying desperately to
*suppress* excel asking the user if they want to save when exiting. The
if/then statements in the middle of the above code works, however for
the other time when the if statements don't apply, excel just keeps
asking if I want to save! Can someone study the above code for me, and
tell me where App.Disp = False goes (if anywhere?)

Thank you muchly.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Application.Displayalerts = value (is not working for me)

Hi
try using
thisworkbook.saved=true
before closing the application

--
Regards
Frank Kabel
Frankfurt, Germany
schrieb im Newsbeitrag
oups.com...
Hi there,

I have some macro code that iniates upon workbook open below:
-------------------------------------------------------------------
Sub workbook_open()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
ws.Visible = xlSheetVisible
Next ws
Worksheets("Error").Visible = xlVeryHidden
Application.Sheets("Sheet1").Select
If Now = Worksheets("Error").Range("AO241") Then
Confirm = MsgBox("This workbook has expired. Please contact support
for further assistance.", vbInformation + vbOKOnly, "Workbook Expiry")
If Confirm = vbOKOnly Then
Application.DisplayAlerts = False
Application.Quit
Else:
Application.DisplayAlerts = False
Application.Quit
End If
Else:
Application.DisplayAlerts = False
End If
End Sub
-------------------------------------------------------------------

As you may notice from my many frustrating attempts (ie:
Application.Displayalerts = False), I am trying desperately to
*suppress* excel asking the user if they want to save when exiting. The
if/then statements in the middle of the above code works, however for
the other time when the if statements don't apply, excel just keeps
asking if I want to save! Can someone study the above code for me, and
tell me where App.Disp = False goes (if anywhere?)

Thank you muchly.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 400
Default Application.Displayalerts = value (is not working for me)

Try:
Replace
Application.DisplayAlerts = False

By

ActiveWorkbook.Saved = True


" wrote:

Hi there,

I have some macro code that iniates upon workbook open below:
-------------------------------------------------------------------
Sub workbook_open()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
ws.Visible = xlSheetVisible
Next ws
Worksheets("Error").Visible = xlVeryHidden
Application.Sheets("Sheet1").Select
If Now = Worksheets("Error").Range("AO241") Then
Confirm = MsgBox("This workbook has expired. Please contact support
for further assistance.", vbInformation + vbOKOnly, "Workbook Expiry")
If Confirm = vbOKOnly Then
Application.DisplayAlerts = False
Application.Quit
Else:
Application.DisplayAlerts = False
Application.Quit
End If
Else:
Application.DisplayAlerts = False
End If
End Sub
-------------------------------------------------------------------

As you may notice from my many frustrating attempts (ie:
Application.Displayalerts = False), I am trying desperately to
*suppress* excel asking the user if they want to save when exiting. The
if/then statements in the middle of the above code works, however for
the other time when the if statements don't apply, excel just keeps
asking if I want to save! Can someone study the above code for me, and
tell me where App.Disp = False goes (if anywhere?)

Thank you muchly.


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default Application.Displayalerts = value (is not working for me)

You have another response at your first post.

wrote:

Hi there,

I have some macro code that iniates upon workbook open below:
-------------------------------------------------------------------
Sub workbook_open()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
ws.Visible = xlSheetVisible
Next ws
Worksheets("Error").Visible = xlVeryHidden
Application.Sheets("Sheet1").Select
If Now = Worksheets("Error").Range("AO241") Then
Confirm = MsgBox("This workbook has expired. Please contact support
for further assistance.", vbInformation + vbOKOnly, "Workbook Expiry")
If Confirm = vbOKOnly Then
Application.DisplayAlerts = False
Application.Quit
Else:
Application.DisplayAlerts = False
Application.Quit
End If
Else:
Application.DisplayAlerts = False
End If
End Sub
-------------------------------------------------------------------

As you may notice from my many frustrating attempts (ie:
Application.Displayalerts = False), I am trying desperately to
*suppress* excel asking the user if they want to save when exiting. The
if/then statements in the middle of the above code works, however for
the other time when the if statements don't apply, excel just keeps
asking if I want to save! Can someone study the above code for me, and
tell me where App.Disp = False goes (if anywhere?)

Thank you muchly.


--

Dave Peterson
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
Application quit without displayalerts Hari[_3_] Excel Programming 3 June 10th 04 08:17 AM
application.displayalerts is not working will lam Excel Programming 2 April 30th 04 08:21 PM
Application.DisplayAlerts in IE scoobydeux Excel Programming 1 April 19th 04 01:28 AM
Application::DisplayAlerts not working Howard Dierking Excel Programming 2 February 11th 04 12:04 PM
application.displayalerts Erin[_5_] Excel Programming 1 December 4th 03 03:49 PM


All times are GMT +1. The time now is 07:20 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"