Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Private Sub Prot()
' Purpose of this macro is to show a possible problem with Excel 2003 ' (Visual Basic 6.3 Version 9972) ' Select another workbook and run this macro twice. First time OK. Second ' time protection is removed from workbook. For i1 = 1 To ActiveWorkbook.Sheets.Count Worksheets(i1).Protect ("PWord7") Next i1 ' Next lines will remove protection second time macro is run - but should not On Error Resume Next ActiveWorkbook.Protect ("PWord7") ie = Err.Number ' 1004=already protected? On Error GoTo 0 End Sub Private Sub Prot2() ' Purpose of this macro is to show 2 possible problems with Excel 2003 ' (Visual Basic 6.3 Version 9972) ' Next line is rejected by Auto Syntax Check activeworkbook.Protect ("PWord3",True,True) ' structure is not picked up as a key word in next line ActiveWorkbook.Protect Password:="PWord4", structu=True, Windows:=True End Sub ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click "I Agree" in the message pane. http://www.microsoft.com/office/comm...el.programming |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Can protect worksheet then workbook but not Protect and Share in code | Excel Programming | |||
Protect Workbook Vs Protect Sheet | New Users to Excel | |||
Disable Tools, Protect, Protect Workbook | Excel Programming | |||
Running a macro to protect a workbook on a already protected workbook UNprotects the workbook ?? | Excel Programming | |||
Password Protect Workbook via code | Excel Programming |