Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2013-01-08
3
Medium Priority
?
374 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 2000 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

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

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

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
After seeing numerous questions for Dynamic Data Validation I notice that most have used Visual Basic to solve the problem. This suggestion is purely formula based and can be used in multiple rows.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

704 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