Custom Right Click Menus - Inconsistent Functionality


L

Lee

I have an Excel Workbook with customized, context sensitive, right
click options. This Workbook is widely distributed to my colleagues,
and I have run into an issue on one computer so far.

While the right click options that I'm adding work perfectly fine on
every other machine so far, one computer simply does not display them.

I have checked the library references in the Excel Workbook, and none
of the required libararies appear to be missing or de-selected on this
system. I have tried re-installing the MSO.DLL file (Microsoft Office
11.0 Object Library) but this didn't solve the problem either.

All of our systems are running Windows XP with Office 2003.

If anyone has seen an issue like this or has any ideas, your comments
are appreciated.

Below is a section of the code I am using to create the custom right
click options:

Private Sub Workbook_SheetBeforeRightClick(ByVal Sh As Object, ByVal
Target As Range, Cancel As Boolean)
Dim cBut As CommandBarButton

On Error Resume Next
For i = 4 To 1 Step -1
If Application.CommandBars("Cell").Controls(i).BuiltIn =
False Then
Application.CommandBars("Cell").Controls(i).Delete
End If
Next i

If ActiveSheet.Index = 2 And ActiveCell.Column = 4 Then
Set cBut =
Application.CommandBars("Cell").Controls.Add(Before:=1,
Temporary:=True)

With cBut
If ActiveCell.Font.Bold = False Then
.Caption = "Lock Date"
Else
.Caption = "Unlock Date"
End If

.BeginGroup = True
.Style = msoButtonCaption
.OnAction = "Module6.LockSelection"

If ActiveCell.Text <> "" And ActiveCell.Row <= LastRow
Then
.Enabled = True
Else
.Enabled = False
End If
End With
...
 
Ad

Advertisements

J

Jim Cone

See response to your question in public.excel.programming.
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware


"Lee" <[email protected]>
wrote in message
I have an Excel Workbook with customized, context sensitive, right
click options. This Workbook is widely distributed to my colleagues,
and I have run into an issue on one computer so far.

While the right click options that I'm adding work perfectly fine on
every other machine so far, one computer simply does not display them.

I have checked the library references in the Excel Workbook, and none
of the required libararies appear to be missing or de-selected on this
system. I have tried re-installing the MSO.DLL file (Microsoft Office
11.0 Object Library) but this didn't solve the problem either.

All of our systems are running Windows XP with Office 2003.

If anyone has seen an issue like this or has any ideas, your comments
are appreciated.

Below is a section of the code I am using to create the custom right
click options:

Private Sub Workbook_SheetBeforeRightClick(ByVal Sh As Object, ByVal
Target As Range, Cancel As Boolean)
Dim cBut As CommandBarButton

On Error Resume Next
For i = 4 To 1 Step -1
If Application.CommandBars("Cell").Controls(i).BuiltIn =
False Then
Application.CommandBars("Cell").Controls(i).Delete
End If
Next i

If ActiveSheet.Index = 2 And ActiveCell.Column = 4 Then
Set cBut =
Application.CommandBars("Cell").Controls.Add(Before:=1,
Temporary:=True)

With cBut
If ActiveCell.Font.Bold = False Then
.Caption = "Lock Date"
Else
.Caption = "Unlock Date"
End If

.BeginGroup = True
.Style = msoButtonCaption
.OnAction = "Module6.LockSelection"

If ActiveCell.Text <> "" And ActiveCell.Row <= LastRow
Then
.Enabled = True
Else
.Enabled = False
End If
End With
...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top