Hey everyone,
I don't know much about but put together this code from a few different posts, but I am getting an error that reads: Compile Error: Ambiguous name detected, workbook_open. It happens when I add the last bit of code to the existing code I already had. Here is all the code
Private Sub Workbook_BeforeClose(Cancel As Boolean)
HideSheets
End Sub
Private Sub Workbook_Open()
UnhideSheets
End Sub
Private Sub HideSheets()
Dim sht As Object
Application.ScreenUpdating = False
ThisWorkbook.Sheets("Macros Disabled").Visible = xlSheetVisible
For Each sht In ThisWorkbook.Sheets
If sht.Name <> "Macros Disabled" Then sht.Visible = xlSheetVeryHidden
Next sht
Application.ScreenUpdating = True
ThisWorkbook.Save
End Sub
Private Sub UnhideSheets()
Dim sht As Object
Application.ScreenUpdating = False
For Each sht In ThisWorkbook.Sheets
sht.Visible = xlSheetVisible
Next sht
ThisWorkbook.Sheets("Macros Disabled").Visible = xlSheetVeryHidden
Application.ScreenUpdating = True
End Sub
Private Sub Workbook_Open()
If Now() > #5/30/2004# Then
Serial = InputBox("Thank You for beta testing. Input required serial number.")
If Serial <> "e4w3t8" Then
ActiveWorkbook.Close
End If
End If
Thanks for any help
I don't know much about but put together this code from a few different posts, but I am getting an error that reads: Compile Error: Ambiguous name detected, workbook_open. It happens when I add the last bit of code to the existing code I already had. Here is all the code
Private Sub Workbook_BeforeClose(Cancel As Boolean)
HideSheets
End Sub
Private Sub Workbook_Open()
UnhideSheets
End Sub
Private Sub HideSheets()
Dim sht As Object
Application.ScreenUpdating = False
ThisWorkbook.Sheets("Macros Disabled").Visible = xlSheetVisible
For Each sht In ThisWorkbook.Sheets
If sht.Name <> "Macros Disabled" Then sht.Visible = xlSheetVeryHidden
Next sht
Application.ScreenUpdating = True
ThisWorkbook.Save
End Sub
Private Sub UnhideSheets()
Dim sht As Object
Application.ScreenUpdating = False
For Each sht In ThisWorkbook.Sheets
sht.Visible = xlSheetVisible
Next sht
ThisWorkbook.Sheets("Macros Disabled").Visible = xlSheetVeryHidden
Application.ScreenUpdating = True
End Sub
Private Sub Workbook_Open()
If Now() > #5/30/2004# Then
Serial = InputBox("Thank You for beta testing. Input required serial number.")
If Serial <> "e4w3t8" Then
ActiveWorkbook.Close
End If
End If
Thanks for any help