Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default User must agree to User Agreement

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


  #2   Report Post  
Posted to microsoft.public.excel.programming
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




  #3   Report Post  
Posted to microsoft.public.excel.programming
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


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default User must agree to User Agreement

Yeah, I forgot those.

Dim WS As Worksheet
For Each WS In ThisWorkbook.Worksheets
WS.Visible = True
Next WS


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



"Myrna Larson" wrote in
message ...
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




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default User must agree to User Agreement

I have one sheet named "Data" that I want to keep hidden. All others should
become visible except the "Data" worksheet. What is the code for that?

I am obviously very new to this type programming. I have to ask, "Does this
code go into a Macro?" Sorry to prove my ignorance.

I will play with it until I get it figured out.
Thanks,
Paul


"Chip Pearson" wrote:

Yeah, I forgot those.

Dim WS As Worksheet
For Each WS In ThisWorkbook.Worksheets
WS.Visible = True
Next WS


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



"Myrna Larson" wrote in
message ...
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







  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 863
Default User must agree to User Agreement

The modify that section to:

For Each WS In ThisWorkbook.Worksheets
If WS.Name < "Data" Then WS.Visible = True
Next WS

All of the code goes into the Worksheet_Open event in the module named
ThisWorkbook.

On Mon, 21 Feb 2005 10:35:05 -0800, "Peepster"
wrote:

I have one sheet named "Data" that I want to keep hidden. All others should
become visible except the "Data" worksheet. What is the code for that?

I am obviously very new to this type programming. I have to ask, "Does this
code go into a Macro?" Sorry to prove my ignorance.

I will play with it until I get it figured out.
Thanks,
Paul


"Chip Pearson" wrote:

Yeah, I forgot those.

Dim WS As Worksheet
For Each WS In ThisWorkbook.Worksheets
WS.Visible = True
Next WS


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



"Myrna Larson" wrote in
message ...
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





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I stop the end user License agreement from popping up http://[email protected] Excel Worksheet Functions 1 December 19th 09 10:14 PM
Office End-User License Agreement Dom Excel Discussion (Misc queries) 8 March 24th 08 02:35 PM
End User License Agreement flkemper Excel Discussion (Misc queries) 2 March 9th 07 12:04 PM
How do i stop the End user License Agreement from Popping Up upon. Excel - Challanged. Excel Discussion (Misc queries) 2 February 15th 05 12:49 AM
How to: Make user click End User License Agreement acceptance jasonsweeney[_21_] Excel Programming 7 January 30th 04 01:41 AM


All times are GMT +1. The time now is 08:22 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"