Solved

Trap Excel 2007 Events in C#

Posted on 2011-03-02
2
527 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
  • 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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

What my article will show is if you ever had to do processing to a listbox without being able to just select all the items in it. My software Visual Studio 2008 crystal report v11 My issue was I wanted to add crystal report to a form and show…
Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
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…

743 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

11 Experts available now in Live!

Get 1:1 Help Now