ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel password but cant hide the sheets before entering password (https://www.excelbanter.com/excel-programming/289744-excel-password-but-cant-hide-sheets-before-entering-password.html)

cakonopka[_3_]

Excel password but cant hide the sheets before entering password
 
Hi there all

I have made my system and i have a small password box on the firs
page, it is just using a password that is on a sheet, in the system,
want to know how i can hide all of the sheets until the right passwor
is entered and it takes me to my main menu sheet.

cheers

from C

--
Message posted from http://www.ExcelForum.com


Ken V.

Excel password but cant hide the sheets before entering password
 
you can try this:

Private Sub Workbook_Open()
ActiveWorkbook.IsAddin = True
If InputBox("Enter Password", "Enter Password") = "ThePassword" Then
'get password here - exit if not
ActiveWorkbook.IsAddin = False
Else
ThisWorkbook.Close savechanges:=False
End If
End Sub



If you are using Excel 97, this may create an application error, depending
on whatelse you do.

Also, if a user doesn't enable macros - workbook is open. You may want to
set the Isaddin property to true before distribution. If macros are not
enabled, the only way then to view the workbook would be to go into the VB
editor and set IsAddin = false, which most people won't know how to do. Of
course, you could also save the workbook with a password - and this would
solve this issue.

Ken V.


"cakonopka " wrote in message
...
Hi there all

I have made my system and i have a small password box on the first
page, it is just using a password that is on a sheet, in the system, i
want to know how i can hide all of the sheets until the right password
is entered and it takes me to my main menu sheet.

cheers

from CK


---
Message posted from http://www.ExcelForum.com/





All times are GMT +1. The time now is 01:26 AM.

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