LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 73
Default Password protect an Excel document

Steve, give this a try,
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
'must lock VBA project so you can't see the password in it
'Input box to verify password before saving
'put in this workbook module
Dim myPassword As String

myPassword = InputBox(prompt:="Please enter the password to proceed:", _
Title:="Password is required to save this file.")
'change password to what you want
If myPassword < "123" Then
MsgBox "Password Is Not Correct"
Cancel = True

Else
End If
End Sub


--
Paul B
Always backup your data before trying something new
Using Excel 97 & 2000
Please post any response to the newsgroups so others can benefit from it
** remove news from my email address to reply by email **

"Steve Quiroz" wrote in message
...
Need to know how allow users to enter a password before
they can save changes to the workbook?




 
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
Password Protect Excel Options Ed O'Brien Excel Discussion (Misc queries) 1 August 6th 09 05:29 PM
How can protect an Excel spreadsheet with a password pascalpinault Excel Discussion (Misc queries) 1 July 30th 09 07:44 PM
Track Changes and Password Protect a Document Meredith Excel Discussion (Misc queries) 0 March 12th 09 05:16 PM
trying to save a document, I get inaccessible or password protect Curlygirl Excel Discussion (Misc queries) 1 May 30th 07 07:52 PM
Password protect an Excel Document from viewing Daisy Excel Discussion (Misc queries) 1 February 9th 07 05:57 PM


All times are GMT +1. The time now is 10:39 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"