Solved

Trap Excel 2007 Events in C#

Posted on 2011-03-02
2
559 Views
Last Modified: 2013-11-26
Hi

I have made a C# Excel 2007 Add-in, that shows some pivot charts.

On a Ribbon I have placed two buttons for toggling the Pivot Chart Filter Pane and the Pivot Table Field List.

I would like to simulate the functionality of the two Toggle Buttons found in Excel -> Analyze -> Show/Hide.

My problem is now how to get my two toggle buttons in sync with the panes.

I need to know how to get a handle to the Excel event for either the two original Toggle buttons or the event when the two panes are shown.

Br
Lars
0
Comment
Question by:liversen
[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
2 Comments
 
LVL 30

Expert Comment

by:MlandaT
ID: 35993352
One method I used to use to determine what a button does behind the scenes was to record a macro and then review the code for that macro and see what Excel was doing behind the scenes. might help you here. record a new macro, click the original toggle buttons then stop recording the macro and see what the code says.
0
 
LVL 30

Accepted Solution

by:
MlandaT earned 500 total points
ID: 35993371
When I try this... if I correctly understood the button you were refering to:
 Button you want.
And the generated code:
 generated macro codeAnd hence:
    ActiveWorkbook.ShowPivotTableFieldList = False
    ActiveWorkbook.ShowPivotTableFieldList = True

Open in new window

0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Reactjs with .NET 3 127
Selenium: Transitioning from unit testing to automated testing 4 98
VB.net Filesystem watcher not working 5 58
Can Selenium do Load Testing? 2 61
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

710 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