S
StargateFanFromWork
Love the archives. Do a lot of the main work after consulting them <g>. I
hunted up one of my old messages where I asked about the filtering problems
on a protected sheet. I found the msg and added the code below to my
workbook (from:
http://groups.google.ca/group/micro...gatefan+protect&rnum=8&hl=en#f1fb8069d19cb8f1):
****************************************************************************
*****
Private Sub Workbook_Open()
Dim I As Integer
For I = 1 To ThisWorkbook.Worksheets.Count
Worksheets(I).Activate
ActiveSheet.EnableAutoFilter = True
ActiveSheet.Protect UserInterfaceOnly:=True
Next I
End Sub
****************************************************************************
*****
I put the above into the "ThisWorkbook" area below the floating toolbar bar
so that that area looks like this:
----------------------------------------------------------------------------
------------------------------
Private Sub Workbook_Activate()
On Error Resume Next
Application.CommandBars("LAR Stats [this bar can be moved]").Visible =
True
End Sub
Private Sub Workbook_Deactivate()
' CommandBars disappear (whilst the workbook remains open, but another is in
view)
On Error Resume Next
Application.CommandBars("LAR Stats [this bar can be moved]").Visible =
False
End Sub
Private Sub Workbook_Open()
Dim I As Integer
For I = 1 To ThisWorkbook.Worksheets.Count
Worksheets(I).Activate
ActiveSheet.EnableAutoFilter = True
ActiveSheet.Protect UserInterfaceOnly:=True
Next I
End Sub
----------------------------------------------------------------------------
------------------------------
After enabling the macros upon opening this file, I get the run-time error
'5':
"Microsoft Visual Basic
Run-time error '5':
Invalid proceudre call or argument"
If I click END on the error box, the floating toolbar still comes up and I
can still filter even though sheet is protected but I'd like to know what to
do to remove this error.
Thanks. D
hunted up one of my old messages where I asked about the filtering problems
on a protected sheet. I found the msg and added the code below to my
workbook (from:
http://groups.google.ca/group/micro...gatefan+protect&rnum=8&hl=en#f1fb8069d19cb8f1):
****************************************************************************
*****
Private Sub Workbook_Open()
Dim I As Integer
For I = 1 To ThisWorkbook.Worksheets.Count
Worksheets(I).Activate
ActiveSheet.EnableAutoFilter = True
ActiveSheet.Protect UserInterfaceOnly:=True
Next I
End Sub
****************************************************************************
*****
I put the above into the "ThisWorkbook" area below the floating toolbar bar
so that that area looks like this:
----------------------------------------------------------------------------
------------------------------
Private Sub Workbook_Activate()
On Error Resume Next
Application.CommandBars("LAR Stats [this bar can be moved]").Visible =
True
End Sub
Private Sub Workbook_Deactivate()
' CommandBars disappear (whilst the workbook remains open, but another is in
view)
On Error Resume Next
Application.CommandBars("LAR Stats [this bar can be moved]").Visible =
False
End Sub
Private Sub Workbook_Open()
Dim I As Integer
For I = 1 To ThisWorkbook.Worksheets.Count
Worksheets(I).Activate
ActiveSheet.EnableAutoFilter = True
ActiveSheet.Protect UserInterfaceOnly:=True
Next I
End Sub
----------------------------------------------------------------------------
------------------------------
After enabling the macros upon opening this file, I get the run-time error
'5':
"Microsoft Visual Basic
Run-time error '5':
Invalid proceudre call or argument"
If I click END on the error box, the floating toolbar still comes up and I
can still filter even though sheet is protected but I'd like to know what to
do to remove this error.
Thanks. D