Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default protection using UserInterfaceOnly

Hello,
I have this code that does not seem to be working in Excel 2003 (it was in
2000):
ActiveSheet.protect UserInterfaceOnly:=True (line 4).
Is there a new equivalence? It was used within a procedure to access the
code via a toolbar.

Sub hideQ1()
Dim cbrCommandBar As CommandBar
Dim cbcCommandBarButton As CommandBarButton
ActiveSheet.protect UserInterfaceOnly:=True
Columns("B:D").Select
Selection.EntireColumn.Hidden = True
Set cbrCommandBar = _
Application.CommandBars("QBR Operating Tool Bar")
If Application.CommandBars("QBR Operating Tool
Bar").Controls.Item(2).Caption _
= " Hide Q1 " Then
With cbrCommandBar.Controls
Set cbcCommandBarButton = cbrCommandBar.Controls.Item(2)
With cbcCommandBarButton
.Style = msoButtonCaption
.Caption = " Show Q1 "
.TooltipText = "Show Quarter 1 / Affiche le 1er trimestre"
.OnAction = "showQ1"
End With
End With
End If
Range("A13").Activate
End Sub

Thank you


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default protection using UserInterfaceOnly

I think it was xl2002 that became more stringent with worksheet protection.

Try adding the password in the .protect line:

ActiveSheet.protect Password:="hi there", UserInterfaceOnly:=True



Learner wrote:

Hello,
I have this code that does not seem to be working in Excel 2003 (it was in
2000):
ActiveSheet.protect UserInterfaceOnly:=True (line 4).
Is there a new equivalence? It was used within a procedure to access the
code via a toolbar.

Sub hideQ1()
Dim cbrCommandBar As CommandBar
Dim cbcCommandBarButton As CommandBarButton
ActiveSheet.protect UserInterfaceOnly:=True
Columns("B:D").Select
Selection.EntireColumn.Hidden = True
Set cbrCommandBar = _
Application.CommandBars("QBR Operating Tool Bar")
If Application.CommandBars("QBR Operating Tool
Bar").Controls.Item(2).Caption _
= " Hide Q1 " Then
With cbrCommandBar.Controls
Set cbcCommandBarButton = cbrCommandBar.Controls.Item(2)
With cbcCommandBarButton
.Style = msoButtonCaption
.Caption = " Show Q1 "
.TooltipText = "Show Quarter 1 / Affiche le 1er trimestre"
.OnAction = "showQ1"
End With
End With
End If
Range("A13").Activate
End Sub

Thank you


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default protection using UserInterfaceOnly

Reposting for an answer.
Thank you
____________
"Learner" wrote in message
...
Hello,
I have this code that does not seem to be working in Excel 2003 (it was in
2000):
ActiveSheet.protect UserInterfaceOnly:=True (line 4).
Is there a new equivalence? It was used within a procedure to access the
code via a toolbar.

Sub hideQ1()
Dim cbrCommandBar As CommandBar
Dim cbcCommandBarButton As CommandBarButton
ActiveSheet.protect UserInterfaceOnly:=True
Columns("B:D").Select
Selection.EntireColumn.Hidden = True
Set cbrCommandBar = _
Application.CommandBars("QBR Operating Tool Bar")
If Application.CommandBars("QBR Operating Tool
Bar").Controls.Item(2).Caption _
= " Hide Q1 " Then
With cbrCommandBar.Controls
Set cbcCommandBarButton = cbrCommandBar.Controls.Item(2)
With cbcCommandBarButton
.Style = msoButtonCaption
.Caption = " Show Q1 "
.TooltipText = "Show Quarter 1 / Affiche le 1er trimestre"
.OnAction = "showQ1"
End With
End With
End If
Range("A13").Activate
End Sub

Thank you




Reply
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
UserInterfaceOnly & Password Protection D.Parker Excel Discussion (Misc queries) 6 October 9th 07 09:46 PM
Excel 2003 Userinterfaceonly Password Protection Problem [email protected] Excel Programming 1 June 8th 05 06:13 PM
UserInterfaceOnly on the Mac rgarber50[_2_] Excel Programming 1 September 25th 04 05:28 PM
question about worksheet protection using userinterfaceonly:=true David Brisco Excel Programming 0 February 9th 04 09:25 PM
Protection UserInterfaceOnly reading Hidden Formulas Rik Ditter Excel Programming 1 July 12th 03 12:50 PM


All times are GMT +1. The time now is 10:27 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"