#1   Report Post  
Posted to microsoft.public.excel.misc
Angeline
 
Posts: n/a
Default Worksheet Protection

Hello,
Is it possible to password protect a worksheet from actually opening up? I
have a series of worksheets one of which should only be opened up with a
password. I can password protect the cells but I was hoping to protect the
worksheet from displaying unless a password is entered.

Hope someone can help.

Angeline
  #2   Report Post  
Posted to microsoft.public.excel.misc
galimi
 
Posts: n/a
Default Worksheet Protection

Angeline,

You can do this with some code. You can create a userform in VBA that has a
password protected text box which can appear through a button on your sheet
or on a menu that will prompt the client for a password when the sheet should
be shown.
--
http://HelpExcel.com
1-888-INGENIO
1-888-464-3646
x0197758


"Angeline" wrote:

Hello,
Is it possible to password protect a worksheet from actually opening up? I
have a series of worksheets one of which should only be opened up with a
password. I can password protect the cells but I was hoping to protect the
worksheet from displaying unless a password is entered.

Hope someone can help.

Angeline

  #3   Report Post  
Posted to microsoft.public.excel.misc
Angeline
 
Posts: n/a
Default Worksheet Protection


Galimi,
Thank you for reply. I do not know how to write VBA. Could you let me know
how to create a user from in VBA and what the code I would need to execute
your suggestion?

Thanks!
Angeline


"galimi" wrote:

Angeline,

You can do this with some code. You can create a userform in VBA that has a
password protected text box which can appear through a button on your sheet
or on a menu that will prompt the client for a password when the sheet should
be shown.
--
http://HelpExcel.com
1-888-INGENIO
1-888-464-3646
x0197758


"Angeline" wrote:

Hello,
Is it possible to password protect a worksheet from actually opening up? I
have a series of worksheets one of which should only be opened up with a
password. I can password protect the cells but I was hoping to protect the
worksheet from displaying unless a password is entered.

Hope someone can help.

Angeline

  #4   Report Post  
Posted to microsoft.public.excel.misc
Paul B
 
Posts: n/a
Default Worksheet Protection

Angeline, here is one way, you will also need to password protect your VBA
project so the password can't be seen there.
But be aware that protection in Excel is very weak and can be overcome very
easy.

Private Sub Worksheet_Activate()
'password protect your VBA project
Dim strPassword As String
On Error Resume Next
Const Password = "123" '**Change password here**

Me.Protect Password:=Password
Me.Columns.Hidden = True

strPassword = InputBox("Enter password to view this sheet", "Password
required !")

If strPassword = "" Then
Me.Previous.Select
Exit Sub
ElseIf strPassword < Password Then
MsgBox "Password Incorrect", , "Wrong password"
Me.Previous.Select
Exit Sub
Else
Me.Unprotect Password:=Password
Me.Columns.Hidden = False
End If

On Error GoTo 0
End Sub

Private Sub Worksheet_Deactivate()
On Error Resume Next
Me.Columns.Hidden = True
On Error GoTo 0
End Sub



To put in this macro right click on the worksheet tab and view code, in the
window that opens paste this code, press Alt and Q to close this window and
go back to your workbook. If you are using excel 2000 or newer you may have
to change the macro security settings to get the macro to run. To change the
security settings go to tools, macro, security, security level and set it to
medium

To change the security settings go to tools, macro, security, security level
and set it to medium



To protect the VBA project, from your workbook right-click the workbook's
icon and pick View Code. This icon is to the left of the "File" menu this
will open the VBA editor, in Project Explorer right click on your workbook
name, if you don't see it press CTRL + r to open the Project Explorer then
select VBA project properties, protection, check lock project for viewing
and set a password. Press Alt and Q to close this window and go back to your
workbook and save and close the file.

And if you are new to macros you may also what to have a look here on
getting started with macros
http://www.mvps.org/dmcritchie/excel/getstarted.htm



--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003

"Angeline" wrote in message
...

Galimi,
Thank you for reply. I do not know how to write VBA. Could you let me know
how to create a user from in VBA and what the code I would need to execute
your suggestion?

Thanks!
Angeline


"galimi" wrote:

Angeline,

You can do this with some code. You can create a userform in VBA that

has a
password protected text box which can appear through a button on your

sheet
or on a menu that will prompt the client for a password when the sheet

should
be shown.
--
http://HelpExcel.com
1-888-INGENIO
1-888-464-3646
x0197758


"Angeline" wrote:

Hello,
Is it possible to password protect a worksheet from actually opening

up? I
have a series of worksheets one of which should only be opened up with

a
password. I can password protect the cells but I was hoping to protect

the
worksheet from displaying unless a password is entered.

Hope someone can help.

Angeline



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
worksheet protection yemi Excel Discussion (Misc queries) 3 May 20th 05 10:12 PM
Worksheet tab protection Xlim Excel Discussion (Misc queries) 2 January 16th 05 01:34 PM
Worksheet tab protection Xieng Lim Excel Discussion (Misc queries) 0 January 16th 05 04:03 AM
copyright and worksheet protection dow Excel Discussion (Misc queries) 2 January 3rd 05 03:07 PM
Seeking help for total worksheet protection Joseph Geretz Excel Discussion (Misc queries) 10 December 31st 04 06:48 PM


All times are GMT +1. The time now is 08:23 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"