ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   vbe-disclaimer (https://www.excelbanter.com/excel-programming/436940-vbe-disclaimer.html)

group changes of spreadsheet[_2_]

vbe-disclaimer
 
I want to set up a work book so that when it opens the user can not go any
further with it until they tick a disclaimer.Once this disclaimer has been
accepted thje work book opens up and the user can open all sheets

RB Smissaert

vbe-disclaimer
 
How about a simple Msgbox in Private Sub Workbook_Open() ?
This is in the ThisWorkbook module.

RBS



"group changes of spreadsheet"
om wrote in message
...
I want to set up a work book so that when it opens the user can not go any
further with it until they tick a disclaimer.Once this disclaimer has been
accepted thje work book opens up and the user can open all sheets



Gord Dibben

vbe-disclaimer
 
And a contingency plan if/when users disable macros on opening the workbook.

Insert a blank sheet named Dummy.

Add a typed message in the center of the sheet like "You have disabled
macros and made this workbook useless. Please close and re-open with macros
enabled."

Stick this code in Thisworkbook module. Save, close and re-open to see
message box.

Private Sub Workbook_Open()
Dim sht As Worksheet
Dim Msg, Style, Title, Response
Msg = "Click Yes to Accept Disclaimer and Continue" & vbLf & _
"Or click No to Close workbook"
Style = vbYesNo
Title = "Disclaimer"
Response = MsgBox(Msg, Style, Title)
If Response = vbYes Then
For Each sht In ActiveWorkbook.Sheets
If sht.Name < "Dummy" Then
sht.Visible = True
End If
Next sht
Sheets("Dummy").Visible = False
Else
ThisWorkbook.Close savechange = False
End If
End Sub

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim sht As Worksheet
Application.ScreenUpdating = False
Sheets("Dummy").Visible = xlSheetVisible
For Each sht In ActiveWorkbook.Sheets
If sht.Name < "Dummy" Then
sht.Visible = xlSheetVeryHidden
End If
Next sht
Application.ScreenUpdating = True
End Sub


Gord Dibben MS Excel MVP

On Wed, 2 Dec 2009 22:08:39 -0000, "RB Smissaert"
wrote:

How about a simple Msgbox in Private Sub Workbook_Open() ?
This is in the ThisWorkbook module.

RBS



"group changes of spreadsheet"
. com wrote in message
...
I want to set up a work book so that when it opens the user can not go any
further with it until they tick a disclaimer.Once this disclaimer has been
accepted thje work book opens up and the user can open all sheets




All times are GMT +1. The time now is 02:58 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com