#1   Report Post  
Keef
 
Posts: n/a
Default No "Options" option

Hi guys,
I recently put the following code in a spreed sheet and lost the
access to options (greyed out):

Sub DisableCuts()
Dim oCtls As CommandBarControls, oCtl As CommandBarControl
Set oCtls = CommandBars.FindControls(ID:=21) ''Cut
If Not oCtls Is Nothing Then
For Each oCtl In oCtls
oCtl.Enabled = False
Next
End If
Set oCtls = CommandBars.FindControls(ID:=522) ''Options
If Not oCtls Is Nothing Then
For Each oCtl In oCtls
oCtl.Enabled = False
Next
End If
With Application
.OnKey "^x", ""
.OnKey "+{Del}", ""
.CellDragAndDrop = False
End With
End Sub

This has effected both home and work computers, the only ones that i
installed this code in... Any ideas?

Regards
Keef


  #2   Report Post  
Jim Rech
 
Posts: n/a
Default

I posted that code. Along with the antidote that you must have lost:

Sub EnableCuts()
Dim oCtls As CommandBarControls, oCtl As CommandBarControl
Set oCtls = CommandBars.FindControls(ID:=21)
If Not oCtls Is Nothing Then
For Each oCtl In oCtls
oCtl.Enabled = True
Next
End If
Set oCtls = CommandBars.FindControls(ID:=522)
If Not oCtls Is Nothing Then
For Each oCtl In oCtls
oCtl.Enabled = True
Next
End If
With Application
.OnKey "^x"
.OnKey "+{Del}"
.CellDragAndDrop = True
End With
End Sub


--
Jim Rech
Excel MVP
"Keef" wrote in message
...
| Hi guys,
| I recently put the following code in a spreed sheet and lost
the
| access to options (greyed out):
|
| Sub DisableCuts()
| Dim oCtls As CommandBarControls, oCtl As CommandBarControl
| Set oCtls = CommandBars.FindControls(ID:=21) ''Cut
| If Not oCtls Is Nothing Then
| For Each oCtl In oCtls
| oCtl.Enabled = False
| Next
| End If
| Set oCtls = CommandBars.FindControls(ID:=522) ''Options
| If Not oCtls Is Nothing Then
| For Each oCtl In oCtls
| oCtl.Enabled = False
| Next
| End If
| With Application
| .OnKey "^x", ""
| .OnKey "+{Del}", ""
| .CellDragAndDrop = False
| End With
| End Sub
|
| This has effected both home and work computers, the only ones that i
| installed this code in... Any ideas?
|
| Regards
| Keef
|
|


  #3   Report Post  
Keef
 
Posts: n/a
Default

thanks jim,
i'm a dill i found it... i will give it a go

regards
keef


"Jim Rech" wrote in message
...
I posted that code. Along with the antidote that you must have lost:

Sub EnableCuts()
Dim oCtls As CommandBarControls, oCtl As CommandBarControl
Set oCtls = CommandBars.FindControls(ID:=21)
If Not oCtls Is Nothing Then
For Each oCtl In oCtls
oCtl.Enabled = True
Next
End If
Set oCtls = CommandBars.FindControls(ID:=522)
If Not oCtls Is Nothing Then
For Each oCtl In oCtls
oCtl.Enabled = True
Next
End If
With Application
.OnKey "^x"
.OnKey "+{Del}"
.CellDragAndDrop = True
End With
End Sub


--
Jim Rech
Excel MVP
"Keef" wrote in message
...
| Hi guys,
| I recently put the following code in a spreed sheet and lost
the
| access to options (greyed out):
|
| Sub DisableCuts()
| Dim oCtls As CommandBarControls, oCtl As CommandBarControl
| Set oCtls = CommandBars.FindControls(ID:=21) ''Cut
| If Not oCtls Is Nothing Then
| For Each oCtl In oCtls
| oCtl.Enabled = False
| Next
| End If
| Set oCtls = CommandBars.FindControls(ID:=522) ''Options
| If Not oCtls Is Nothing Then
| For Each oCtl In oCtls
| oCtl.Enabled = False
| Next
| End If
| With Application
| .OnKey "^x", ""
| .OnKey "+{Del}", ""
| .CellDragAndDrop = False
| End With
| End Sub
|
| This has effected both home and work computers, the only ones that i
| installed this code in... Any ideas?
|
| Regards
| Keef
|
|




  #4   Report Post  
Keef
 
Posts: n/a
Default

it's funny how it effects excel for every spreedsheet i've done since???



"Jim Rech" wrote in message
...
I posted that code. Along with the antidote that you must have lost:

Sub EnableCuts()
Dim oCtls As CommandBarControls, oCtl As CommandBarControl
Set oCtls = CommandBars.FindControls(ID:=21)
If Not oCtls Is Nothing Then
For Each oCtl In oCtls
oCtl.Enabled = True
Next
End If
Set oCtls = CommandBars.FindControls(ID:=522)
If Not oCtls Is Nothing Then
For Each oCtl In oCtls
oCtl.Enabled = True
Next
End If
With Application
.OnKey "^x"
.OnKey "+{Del}"
.CellDragAndDrop = True
End With
End Sub


--
Jim Rech
Excel MVP
"Keef" wrote in message
...
| Hi guys,
| I recently put the following code in a spreed sheet and lost
the
| access to options (greyed out):
|
| Sub DisableCuts()
| Dim oCtls As CommandBarControls, oCtl As CommandBarControl
| Set oCtls = CommandBars.FindControls(ID:=21) ''Cut
| If Not oCtls Is Nothing Then
| For Each oCtl In oCtls
| oCtl.Enabled = False
| Next
| End If
| Set oCtls = CommandBars.FindControls(ID:=522) ''Options
| If Not oCtls Is Nothing Then
| For Each oCtl In oCtls
| oCtl.Enabled = False
| Next
| End If
| With Application
| .OnKey "^x", ""
| .OnKey "+{Del}", ""
| .CellDragAndDrop = False
| End With
| End Sub
|
| This has effected both home and work computers, the only ones that i
| installed this code in... Any ideas?
|
| Regards
| Keef
|
|




  #5   Report Post  
Jim Rech
 
Posts: n/a
Default

it's funny how it effects excel for every spreedsheet i've done since???

When changes are made to the menus or toolbars, either manually or by
macros, they are recorded in you toolbar file (Excelx.XLB) and restored each
time you restart Excel. The changes have no link to the workbook that
happens to be open at the time. So when Options was disable, it's disabled
"permanently".

"Permanently" meaning until a macro enables it, or you delete your XLB file
(with Excel closed) (this resets ALL menus/toolbars to their default
settings), or you use View, Toolbars, Customize, Toolbars, pick a
toolbar/menubar, and click Reset.

--
Jim Rech
Excel MVP




  #6   Report Post  
Keef
 
Posts: n/a
Default

thanks for the tip jim, is there any way to disable cut in a workbook and
have it follow the workbook around, not harming the excel application?



"Jim Rech" wrote in message
...
it's funny how it effects excel for every spreedsheet i've done since???


When changes are made to the menus or toolbars, either manually or by
macros, they are recorded in you toolbar file (Excelx.XLB) and restored
each
time you restart Excel. The changes have no link to the workbook that
happens to be open at the time. So when Options was disable, it's
disabled
"permanently".

"Permanently" meaning until a macro enables it, or you delete your XLB
file
(with Excel closed) (this resets ALL menus/toolbars to their default
settings), or you use View, Toolbars, Customize, Toolbars, pick a
toolbar/menubar, and click Reset.

--
Jim Rech
Excel MVP




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
XML Data menu option -- not listed / available. How do you fix thi meingotham Excel Discussion (Misc queries) 1 January 27th 05 09:46 PM
Option Button on Forms Toolbar admannj Excel Discussion (Misc queries) 4 January 25th 05 01:07 AM
How to protect Option button in worksheet Julie Excel Worksheet Functions 2 January 4th 05 01:01 AM
Pivot Table Refresh Options PROVEXCEL Excel Discussion (Misc queries) 2 December 17th 04 12:33 PM
What does Insert>name>LABEL option do ? Ali.Abbas.810 Excel Discussion (Misc queries) 1 December 5th 04 08:40 AM


All times are GMT +1. The time now is 09:50 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"