E
eagle13
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.
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.