View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Myrna Larson Myrna Larson is offline
external usenet poster
 
Posts: 863
Default User must agree to User Agreement

Hi, Chip:

In the Open event procedure, didn't you omit the lines to unhide the
worksheets if the user agrees?

Myrna

On Sun, 20 Feb 2005 12:19:19 -0600, "Chip Pearson" wrote:

You can accomplish #1 in the following manner. First, put your
disclaimer text on a worksheet named "Disclaimer". Then, hide all
other worksheets, so that only Disclaimer is visible. In the
ThisWorkbook code module, put the following code:

Private Sub Worksheet_Open()
If MsgBox("Do you agree to the disclaimer?",vbYesNo) = vbNo
Then
ThisWorkbook.Close savechanges:=False
End If
End Sub

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim WS As Worksheet
For Each WS In ThisWorkbook.Worksheets
If WS.Name < "Disclaimer"
WS.Visible = xlVeryHidden
End If
Next WS
End Sub