View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Tim879 Tim879 is offline
external usenet poster
 
Posts: 208
Default Password Protecting an Excel file problem

Try using the attached macro.


Sub Save_Protected_WB()
'
' Saves a file as password protected to open / modify with password
entered by user
' Macro recorded 9/10/2007 by T. Bradshaw
'
'

On Error GoTo Exit_Save_Protected

Password = ""
ConfirmPassword = " "

CurrentWBName = ActiveWorkbook.FullName

While Password < ConfirmPassword
Password = InputBox("Please enter a password: ")
ConfirmPassword = InputBox("Please confirm the password: ")
Wend


ActiveWorkbook.SaveAs Filename:=CurrentWBName, FileFormat:= _
xlNormal, Password:=Password, WriteResPassword:=Password,
ReadOnlyRecommended:= _
True, CreateBackup:=False


Exit_Save_Protected:
Application.DisplayAlerts = True

End Sub





On Mar 6, 7:25 am, Tolga wrote:
Hi,

I'm trying to password protect an excel file so that a user will be prompted
for a password in order to see that data sheet.

My colleagues are able to this by doing the following steps:
Save as, Tools menu, then General options, then setting a password within
here.

When i try to this i can only get as far as, Save as, then for me there is
an icon for tools instead of tools text menu. and when i do press this menu
i only get three options: Find, Add to favorites and Properties.

When i select properties nothing happens.

We all use the same Excel version (2000). My IT department have tried
reinstalling this version of Excel and even upgrading to 2003 but this has
still not solved the problem.

Can anyone help?

Thanks
Tolga