Consulting

Results 1 to 2 of 2

Thread: stop closing a worksheet unless press a button

  1. #1
    VBAX Newbie
    Joined
    Mar 2007
    Posts
    1
    Location

    Unhappy stop closing a worksheet unless press a button

    I have a problem regarding stopping user to close a file unless the user press a button with macro embeded. The macro triggers to hide just one worksheet but not the others. When the user re-opens the file, he needs to press a button with password in order to read the worksheet being hidden.
    Is it very difficult? I am a beginner of Excel VBA. It would be very appreciated if you can help me and explain to me with an example.
    With many thanks in advance.

  2. #2
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    Why not put your code to hide the one worksheet in the thisworkbook module using a before close event. Then it would not matter how they close the workbook the event would run and the sheet would be hidden.
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

Posting Permissions

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