Microsoft Excel - Is it possible to create a password on an Excel Sheet if somebody would like to open it?

Asked By maze zim on 19-Feb-13 05:00 AM

Im creating a document wherein I would like to hide sheet2 but if someone would like to unhide-it it will prompt for a password/passcode before it displays the contents else it will go back to sheet1.

I've tried several Macro code but I'm having a hard time
Can you help me?

Danasegarane Arunachalam replied to maze zim on 19-Feb-13 06:47 AM
Hope this helps
White Ashlin replied to maze zim on 21-Feb-13 04:37 AM
If you do not want to let others edit or modify the worksheets, you can lock them by password as below code:
        Workbook workbook = new Workbook();
        Worksheet sheet = workbook.Worksheets[0];
        Worksheet sheet1 = workbook.Worksheets[1];
but if you do not want to let others see the worksheet, while not want to hide it, I think the best way is to copy these sheets to another new excel sheets and encrypt the whole excel file,and delete the sheets in the original excel. you can see the detail here in source code page: