Solved

VB.net Excel Add-In Right Click menu doesn't appear when clicking a pivot

Posted on 2013-01-08
3
353 Views
Last Modified: 2013-01-08
Hi. I used the following code to build a rigt click menu. It works when I right click on the
Sheet but not when I click on the pivot


   Dim cBut As CommandBarButton

        Try
            Application.CommandBars("Cell").Controls("My Macro").Delete()
        Catch ex As Exception
            'No message as error will occur if "My Macro" not there
        End Try

        Try

            cBut = Application.CommandBars("Cell").Controls.Add(Temporary:=True)

            With cBut

                .Caption = "My Macro"

                .Style = MsoButtonStyle.msoButtonCaption

                .OnAction = "My_Macro"

            End With
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
0
Comment
Question by:murbro
  • 2
3 Comments
 
LVL 85

Expert Comment

by:Rory Archibald
ID: 38753916
The standard Cell menu is not displayed if you right-click a pivot cell - you get the "PivotTable Context Menu" instead.
0
 
LVL 85

Accepted Solution

by:
Rory Archibald earned 500 total points
ID: 38753919
Also, FYI, there are in fact 2 Cell menus - one for Normal view and the other for Page Break Preview view.
0
 

Author Closing Comment

by:murbro
ID: 38753990
Thanks Rory.
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

INDEX and MATCH can be used to great effect to replace HLOOKUP and VLOOKUP as it does not have the limitation of needing the data to be sorted so that the reference value is in the first column or row. It also has the ability to perform a bi-directi…
Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now