![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Feb 2002
Posts: 48
|
I have some password protected worksheets which need to be shared with various users to enter data. Sometimes people find it ammusing to change the password! Is there a way I can stop them from changing the password?
Any help please as it takes hours to crack the password and I can't stop people doing it! [ This Message was edited by: Andy Gee on 2002-02-27 07:08 ] |
|
|
|
|
#2 |
|
Legend
Join Date: Feb 2002
Location: Minneapolis, Mn, USA
Posts: 9,704
|
Follow this link. The file at this site will crack a sheet's password pronto (less than 1 min.)
http://www.straxx.com/excel/password.html Cheers, Nate [ This Message was edited by: NateO on 2002-02-27 08:03 ] |
|
|
|
|
#3 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Central Florida, USA
Posts: 7,541
|
I put form buttons on the sheet to lock and unlock, the password is hardcoded into the VBA code and hidden. This way the user cannot change the password.
This code gos on the sheet module: Private Sub Worksheet_Change(ByVal Target As Range) ' ' Macro by Joseph S. Was ' Application.EnableEvents = False ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True, Password:="admin" Application.EnableEvents = True End Sub This code gos on the module: Sub myUnLock() 'This code will unprotect the sheet. Application.EnableEvents = False Application.DisplayAlerts = False ActiveSheet.Unprotect ("admin") 'Add optional code here! Application.EnableEvents = True Application.DisplayAlerts = True End Sub This is a very simple form of this. If this is the route you want to try, I have some very complex systems? JSW [ This Message was edited by: Joe Was on 2002-02-27 08:58 ] |
|
|
|
|
#4 |
|
New Member
Join Date: Feb 2002
Posts: 48
|
This is very usefull and I'm sure I'll use it in the future but it dosent help with those folks changing the main password when they save the workbook. Is there a way I could disable the 'save as' option? thus bypassing the point where the canges to the password can be made?
|
|
|
|
|
#5 |
|
Guest
Posts: n/a
|
Andy,
Use the code below (open VBE and place in "Thisworkbook" object): Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, cancel As Boolean) If SaveAsUI Then cancel = True End If End Sub This prevents users from using "Save As" with this file, thus not allowing them to change the password. Hope this helps. Aloha! p.s. Also, be sure to password protect your vba code so that people can't go into VBE and disable this. (VBE Menu Bar: Tools | VBAProject Properties, Protection tab). |
|
|
#6 |
|
New Member
Join Date: Feb 2002
Location: ]-[ /-\ \/\/ /-\ | | ~~~@|_()]-[/-\!!!
Posts: 48
|
Hi Andy,
That last post was from me. (Just testing to see why my name appeared as anonymous when I was logged in!) Aloha! |
|
|
|
|
#7 |
|
Board Regular
Join Date: Feb 2002
Posts: 7,743
|
Wasssuuupp Hawaiian!
What island you on? Brian |
|
|
|
|
#8 |
|
New Member
Join Date: Feb 2002
Location: ]-[ /-\ \/\/ /-\ | | ~~~@|_()]-[/-\!!!
Posts: 48
|
waaaaaazuuuup boo,
Oahu...good to see fellow kamaaina here! Aloha! |
|
|
|
|
#9 |
|
Board Regular
Join Date: Apr 2002
Location: Cape Town,South Africa
Posts: 234
|
Follow NateO's suggestion,That is the way I did it and it works.Trust me.
|
|
|
|
|
#10 |
|
Board Regular
Join Date: Jun 2002
Posts: 207
|
Hey Joe, can you tell me how to use the form button to lock and unlock? Thanks.
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|