• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Form control - context menu not appearing on mouse right click for Button

Thomas Kuriakose

Active Member
Respected Sirs,

I inserted a button from form controls on my worksheet and wanted to assign a macro, but on clicking the right mouse button, the below options are only available.

Kindly let me know how to get the context menu or is there some error. I am using Excel 2016.

upload_2017-2-27_21-15-35.png

Thank you very much,

with regards,
thomas
 
Thomas Kuriakose

The said menu appears when your object left this original position even by a small fraction of pixel.

Try this..

In VBA immediate window!

Code:
ActiveSheet.Shapes("X").Select

Then press Shift+F10
 
@Deepak Sir, Respected Sir, on entering this in the immediate window, I get the following message -
upload_2017-2-28_9-2-20.png

Kindly let me know where I am going wrong.

Thank you very much,

with regards,
thomas
 
@Deepak Sir, Respected Sir,

I changed the code to the below -

ActiveSheet.Shapes("Option Button 2").Select. I am still not getting the menu on right click of mouse.

There are multiple option buttons and multiple form control buttons in the workbook.

Kindly let me know how to get the right click mouse working with the menu.

Thank you very much,

with regards,
Thomas

A dummy file is clipped for your reference.
 

Attachments

  • Test.xlsm
    23.5 KB · Views: 4
Working fine here! Office 2007.

Workaround!

Code:
ActiveSheet.Shapes("Option Button 2").OnAction = "test"

or

Code:
Sub AssignMacro()
Dim o As Object
Set o = ActiveSheet.Shapes("Option Button 7")
If Not o Is Nothing Then
    o.Select
    Application.CommandBars(108).Controls(9).Execute
End If
Set o = Nothing
End Sub

Will Check with 2013 at night.
 

Attachments

  • Test.xlsm
    18.9 KB · Views: 4
@Deepak Sir,

Respected Sir,

Thank you so much for the workaround.

Sir, I am still not getting the menu on right click of the mouse button.

There are multiple option buttons and multiple form control buttons. When I try to select Button 1 in form control and go to view code, it gives me "Reference isn't valid message"

upload_2017-2-28_19-53-14.png

The option buttons are not giving menu on right click.

Thank you very much,

with regards,
thomas
 
Respected Sir,

Thank you for your support on this issue.

Our IT went to the registry and change the excel to excel.bak and this helped in resolving the issue.

Thank you very much,

with regards,
thomas
 
Back
Top