Solved

Trap Excel 2007 Events in C#

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
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…

810 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