Hi all,
I am using this code to open a workbook with a splash screen as follows. Unfortunately when I enter it and try to exit, I get an error which states:
"Compile error:
Ambiguous name detected: Workbook_BeforeClose"
What should i do to correct it?
I am using this code to open a workbook with a splash screen as follows. Unfortunately when I enter it and try to exit, I get an error which states:
"Compile error:
Ambiguous name detected: Workbook_BeforeClose"
What should i do to correct it?
Code:
Private Sub Workbook_Open()
MSG1 = MsgBox("Spreadsheet created by ABC." & Chr(10) & Chr(10) & _"2019." & Chr(10) & Chr(10) & _
"By selecting Yes to this message box you agree to the following Terms of Use:" & Chr(10) & _
"No part of this product may be shared with third parties." & Chr(10) & _ Chr(10) &
"The information held within is accurate as of Jan 2019." & Chr(10) & Chr(10) & _
"Contact Us: xx@xx.com", vbYesNo, "Terms of Use")
If MSG1 = vbYes Then ActiveSheet.Range("A1").Select
Else MsgBox "This Workbook Will Now Close"
ActiveWorkbook.Close SaveChanges = False
End If
With Application
.ShowChartTipNames = False
.ShowChartTipValues = False
End With
AppEventsOn
Worksheets(1).Activate
ActivateSheet ActiveSheet
Dim exdate As Date
exdate = "12/12/2020"
If Date > exdate Then
MsgBox ("You have reached end of your time")
ActiveWorkbook.Close
End If
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
With Application
.ShowChartTipNames = True
.ShowChartTipValues = True
End With
AppEventsOff
End Sub
--------------------------------------------------------------------
Private Sub Workbook_BeforeClose(Cancel As Boolean)'
--------------------------------------------------------------------
With Application
.ShowChartTipNames = True
.ShowChartTipValues = True
End With AppEventsOff
End Sub
Last edited: