Solved

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

Posted on 2013-01-08
3
373 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:Murray Brown
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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:Murray Brown
ID: 38753990
Thanks Rory.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…

624 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