View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default User must agree to User Agreement

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


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com





"Peepster" wrote in message
...
Please be advised that I am a bit new to the "more advanced"
programming.

I am seeking help with programing a workbook where a user must
agree with a
disclaimer before the workbook will either:

1) File to open to the disclaimer worksheet only, and then only
allow user
to enter other worksheets within the workbook after the user
agrees to a
disclaimer. -Preferred-

2) File will not open until they click to agree to a
disclaimer.

Thanks in advance