Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 533
Default 2007 Ribbon control disabled by Excel when sheet is protected - Override with getEnabled?

I think you guys have it right. MS does not want you changing the number of
controls that appear in their built-in groups. And no way to enable a
button Excel has disabled. So you've got to have duplicate spellcheck
buttons, Walt.

--
Jim
"Walt" wrote in message
...
| Hi Ron,
|
| So, I think you must have found the same result. Excel's disabling
| of the Spelling control on the Ribbon and Quick Access Toolbar when a
| worksheet is protected cannot be managed.
|
| I was able to load your posted code and it works OK. But when I
| tried to make it look cleaner and substitute visible for enabled in
| <command idMso="Spelling" enabled = "false" /, I saw the error
| message "The 'visible' attribute is not declared". Also, as I
| suspected, the Quick Access Toolbar shows the Spelling button as
| visible but not enabled. Managing the Built-In control would be a
| nicer solution if possible.
|
| I appreciate your thoughts on this Ron.
|
| Best Regards,
| Walt
|
|
| On Feb 19, 12:17 pm, "Ron de Bruin" wrote:
| Not looked very good but I think I go for this (Easy I think)
| And in Macro1 add your unprotect/spelling/protect
|
| 'Callback for customButton1 onAction
| Sub Macro1(control As IRibbonControl)
| ActiveSheet.Unprotect
| Cells.CheckSpelling SpellLang:=1033
| ActiveSheet.Protect
| End Sub
|
| And this is the xml to disable the normal spelling and add a new button
|
| <customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui"
|
| <commands
|
| <!-- Example to disable Spelling--
| <command idMso="Spelling" enabled = "false" /
|
| </commands
|
| <ribbon
| <tabs
|
| <tab idMso="TabReview"
| <group id="customGroup1" label="My Spelling"
insertBeforeMso="GroupProofing"
| <button id="customButton1" label="Spelling" size="large"
onAction="Macro1" imageMso="Spelling" /
| </group
| </tab
|
| </tabs
| </ribbon
| </customUI
|
| --
|
| Regards Ron de Bruinhttp://www.rondebruin.nl/tips.htm
|


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default 2007 Ribbon control disabled by Excel when sheet is protected -Override with getEnabled?

Hi Ron & Jim,

I may not like the answer, but I understand and I thank you both for
the consideration.

An instance where I've enabled and intercepted the spell checker in
the past has been:

Sub UnlockedSpellCK() 'PROTECTED SHEET UNLOCKED CELLS SPELL CHECKER
Dim TstRng As Range, CL As Range
On Error GoTo UnlockedSpellCKERROR
With ActiveSheet
Set TstRng = .Range("AB1") 'ANY KNOWN EMPTY CELL JUST TO
GET STARTED
For Each CL In .UsedRange.Cells
If CL.Locked = False Then Set TstRng =
Application.Union(TstRng, CL)
Next
.Unprotect
TstRng.CheckSpelling
.Protect DrawingObjects:=False, Contents:=True,
Scenarios:=True
End With
Set TstRng = Nothing: Set CL = Nothing
Exit Sub
UnlockedSpellCKERROR:
Set TstRng = Nothing: Set CL = Nothing
ActiveSheet.Protect DrawingObjects:=False, Contents:=True,
Scenarios:=True
MsgBox "Error in 'UnlockedSpellCK' routine."
End Sub

In it, I only spell check the UnLocked cells that the user has access
to change. An even nicer solution would be if Excel, by default,
didn't completely disable the spell checker when a protected sheet is
active, but would just check any UnLocked cells.

Best Regards,
Walt

On Feb 20, 7:45�am, "Jim Rech" wrote:
I think you guys have it right. �MS does not want you changing the number of
controls that appear in their built-in groups. �And no way to enable a
button Excel has disabled. �So you've got to have duplicate spellcheck
buttons, Walt.

--
Jim

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default 2007 Ribbon control disabled by Excel when sheet is protected - Override with getEnabled?

Hi Walt

You can hide the group

<tab idMso="TabReview"
<group idMso="GroupProofing" visible="false"/
</tab

And make a new one with the same buttons and your own spelling button
Nicer then two spelling buttons

But if the use have it in the QAT you still have the problem that the user can't use that option


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Walt" wrote in message ...
Hi Ron & Jim,

I may not like the answer, but I understand and I thank you both for
the consideration.

An instance where I've enabled and intercepted the spell checker in
the past has been:

Sub UnlockedSpellCK() 'PROTECTED SHEET UNLOCKED CELLS SPELL CHECKER
Dim TstRng As Range, CL As Range
On Error GoTo UnlockedSpellCKERROR
With ActiveSheet
Set TstRng = .Range("AB1") 'ANY KNOWN EMPTY CELL JUST TO
GET STARTED
For Each CL In .UsedRange.Cells
If CL.Locked = False Then Set TstRng =
Application.Union(TstRng, CL)
Next
.Unprotect
TstRng.CheckSpelling
.Protect DrawingObjects:=False, Contents:=True,
Scenarios:=True
End With
Set TstRng = Nothing: Set CL = Nothing
Exit Sub
UnlockedSpellCKERROR:
Set TstRng = Nothing: Set CL = Nothing
ActiveSheet.Protect DrawingObjects:=False, Contents:=True,
Scenarios:=True
MsgBox "Error in 'UnlockedSpellCK' routine."
End Sub

In it, I only spell check the UnLocked cells that the user has access
to change. An even nicer solution would be if Excel, by default,
didn't completely disable the spell checker when a protected sheet is
active, but would just check any UnLocked cells.

Best Regards,
Walt

On Feb 20, 7:45�am, "Jim Rech" wrote:
I think you guys have it right. �MS does not want you changing the number of
controls that appear in their built-in groups. �And no way to enable a
button Excel has disabled. �So you've got to have duplicate spellcheck
buttons, Walt.

--
Jim


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
Charts disabled in Excel 2007 ribbon Jeff Reese Excel Discussion (Misc queries) 2 May 13th 08 10:39 PM
Indenting Disabled when Sheet is Protected sneary Excel Discussion (Misc queries) 1 February 4th 08 09:49 PM
[Office 2007] Auto-hide ribbon toggle button and control recent do Yishion Excel Programming 2 June 4th 07 08:27 PM
Excel 2007: Macros disabled when workbook is protected (why?) Jim Rech Excel Programming 1 December 19th 06 05:07 PM
Hand Cursor / Disabled Mouse When Sheet is Protected EanW Excel Programming 0 August 23rd 06 05:25 AM


All times are GMT +1. The time now is 11:01 AM.

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

About Us

"It's about Microsoft Excel"