Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
protect with password
hi, the following code starts with unprote the sheet and end with protected sheet, now the problem is anybody can unprotect the sheet and do something in the sheet . to avoid that i wanted to protect the sheet with my own password say 'nowfal'. Is it possible to do that . if so please help me in this matter . Sub FCY2() ' ' FCY2 Macro ' Macro recorded 15/07/2004 by Musandam ' ' ActiveSheet.Unprotect Sheets("BILL").Select ActiveWindow.SelectedSheets.PrintOut Copies:=1 Sheets("RECORD").Select Range("A2:AH12000").Select Selection.Copy Range("A3").Select ActiveSheet.PasteSpecial Format:=3, Link:=1, DisplayAsIcon:=False, _ IconFileName:=False Range("C2:H2").Select Selection.ClearContents Range("J2:L2").Select Selection.ClearContents Range("N2").Select Selection.ClearContents ActiveWindow.SmallScroll ToRight:=6 Range("O2:R2").Select Selection.ClearContents Range("T2:W2").Select Selection.ClearContents Range("Y2:AB2").Select Selection.ClearContents Range("AD2:AG2").Select Selection.ClearContents ActiveWindow.ScrollColumn = 1 Range("D2").Select ActiveSheet.Protect DrawingObjects:=True, Scenarios:=True ActiveWorkbook.Save End Sub -- nowfal ------------------------------------------------------------------------ nowfal's Profile: http://www.excelforum.com/member.php...o&userid=10003 View this thread: http://www.excelforum.com/showthread...hreadid=386565 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
protect with password
Sub ProtectSheet() Dim Password Password = "nowfal" ActiveSheet.Protect Password, True, True, True End Sub Sub UnProtectSheet() Password = "nowfal" ActiveSheet.Unprotect Password End Sub -- Losse ------------------------------------------------------------------------ Losse's Profile: http://www.excelforum.com/member.php...o&userid=24813 View this thread: http://www.excelforum.com/showthread...hreadid=386565 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
protect with password
HI, Sorry its not working, i repeat and shorten the code ActiveSheet.Unprotect ActiveSheet.Protect DrawingObjects:=True, Scenarios:=True ActiveWorkbook.Save End Sub that unprotect with password say 'nowal' at the end protect with same password. eagerly waiting for the solution. thanks in advance with regards nowfa -- nowfa ----------------------------------------------------------------------- nowfal's Profile: http://www.excelforum.com/member.php...fo&userid=1000 View this thread: http://www.excelforum.com/showthread.php?threadid=38656 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
protect with password
Good evening Nowfal Change this line: ActiveSheet.Protect DrawingObjects:=True, Scenarios:=True to this: ActiveSheet.Protect DrawingObjects:=True, Scenarios:=True, Password:="nowfal" Is that any better? HTH DominicB -- dominicb ------------------------------------------------------------------------ dominicb's Profile: http://www.excelforum.com/member.php...o&userid=18932 View this thread: http://www.excelforum.com/showthread...hreadid=386565 |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
protect with password
Hi, Mr.Dominic , sorry that is not working any other solution?, earlie Late Mr.Frank kablin had given some idea , but i couldn't follow up after sometime that great man left the world by tragic accident. Stil i remember his contribution to this forum. May God bless him. regards nowfa -- nowfa ----------------------------------------------------------------------- nowfal's Profile: http://www.excelforum.com/member.php...fo&userid=1000 View this thread: http://www.excelforum.com/showthread.php?threadid=38656 |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
protect with password
Hi Nowfal It does work. Copy this code in its entirity into a moduleof a blan workbook. Run it, and then try to unprotect the sheet (Tools Protection Unprotect Sheet. You will be prompted for a password the password is "nowfal", without the quotes. Sub ProtectSheet() ActiveSheet.Protect DrawingObjects:=True, Scenarios:=True Password:="nowfal" End Sub HTH Dominic -- dominic ----------------------------------------------------------------------- dominicb's Profile: http://www.excelforum.com/member.php...fo&userid=1893 View this thread: http://www.excelforum.com/showthread.php?threadid=38656 |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
protect with password
hi , sorry to say its not working. Still i am short of my requirement. when i am firing the macro i am getting the unprotect box , which i am not expecting , my intention is no other user can unprotect the sheet without my permission, and in the mean while they and myself can able to do the normal job. with regards nowfal -- nowfal ------------------------------------------------------------------------ nowfal's Profile: http://www.excelforum.com/member.php...o&userid=10003 View this thread: http://www.excelforum.com/showthread...hreadid=386565 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Password Protect | Excel Worksheet Functions | |||
Password Protect | Excel Discussion (Misc queries) | |||
Password Protect | Excel Discussion (Misc queries) | |||
Password Protect | Excel Worksheet Functions | |||
password protect | Excel Discussion (Misc queries) |