Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Trap Excel 2007 Events in C#

Posted on 2011-03-02
2
Medium Priority
?
580 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 31

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 31

Accepted Solution

by:
MlandaT earned 1500 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
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…

972 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