Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
Application.Displayalerts = value (is not working for me)
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Application quit without displayalerts | Excel Programming | |||
application.displayalerts is not working | Excel Programming | |||
Application.DisplayAlerts in IE | Excel Programming | |||
Application::DisplayAlerts not working | Excel Programming | |||
application.displayalerts | Excel Programming |