PDA

View Full Version : stop closing a worksheet unless press a button



bbt
03-22-2007, 07:35 AM
:hi: 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.

lucas
03-22-2007, 07:42 AM
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.