+ Reply to Thread
Results 1 to 4 of 4

Advisory "window" that appears when opening a spreadsheet

Hybrid View

  1. #1
    Registered User
    Join Date
    01-05-2008
    Posts
    12

    Advisory "window" that appears when opening a spreadsheet

    Hi all.
    I would like to design an advisory or note that appears each time my spreadsheet is opened where the user would have to click, "OK" to continue. I have not been able to find help on this anywhere.
    Specifically, when anyone opens my spreadsheet, I would like the note to read something to the effect of, "This spreadsheet is copyrighted to *insert name here* and may not be distributed, altered, etc etc...Clicking "OK" consitutes consent and etc etc." Just thinking as I type, but would it even be possible to provide an option to the above note to click "OK" to continue or "Close," which would then close the spreadsheet?
    Does this functionality exist? Many thanks!
    - John

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689
    You have to force the user to enable macros to use the spreadsheet. A way to do this is to keep all sheets except the splash sheet VeryHidden, and unhide them in VBA only after receiving the acknowledgement (via a button on the splash sheet).

    Rehide all but the splash sheet in the Close event.

    Password-protect the VBA project.

    And remember that no security aspect of Excel is bulletproof ...

  3. #3
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Copyright

    Hi,
    The code below will produce a Message Box with your copyright details and a Yes and No Button. If you click "Yes" the sheet will remain open, if you click "No" the sheet will close.
    The code below must be entered in a "Workbook_ Open" event code window.
    Do this as follows:-
    Open the desired workbook and Click "Alt + F11"--- code window appears.
    If its blank or there is no left hand pane, Click "Ctrl +R" ---Project window appears on left of code window
    In the Project window you will see the sheet numbers, at the bottom of the sheet numbers you will see the words "This Workbook", double click it. Workbook code window appears on right.
    At the top of the this right hand window, on the left hand side there is a drop down box. Select "Workbook"
    On the right hand side there is another drop down box. Select "Open" from the list.
    A "Workbook_Open" Event will appear in the code window.
    Paste the code below into it.
    (Between the words "Workbook_Open and End Sub")
    Edit the code with the correct Workbook name, where it shows "My Worksheet.xls"
    Edit the text to suit, if you get a problem let me know.

    Dim ans As String
    ans = MsgBox("This spreadsheet is copyrighted " _
    	& "to *insert name here*" & vbNewLine & _
    	"and may not be distributed, altered, etc etc.." _
    	& vbNewLine & vbNewLine & "Clicking ""OK"" consitutes" _
    	& " consent and etc etc.", vbYesNo, "Copyright Notice")
    
    If ans = vbNo Then Workbooks("My Workbook.xls").Close
    Regards
    Mick

  4. #4
    Registered User
    Join Date
    01-05-2008
    Posts
    12
    Mick and shg,
    This is perfect! Mick, thanks for the step by step...I'm totally clueless when it comes to macros. I couldn't adjust the spacing exactly the way I wanted it, but I'll keep working on it. I was able to get the wording right.

    shg,
    Can you explain a little more with your post? I was a little lost.
    Also, this is merely one sheet in my overall workbook. Will copying this sheet into my workbook have any adverse effects or will I have to rewrite the macros? I would imagine that I may have to change the workbook name in the macro itself. Thanks!
    As a reference, I've included the spreadsheet in question taken from my workbook.
    - John
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1