ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Pivot Table Events (https://www.excelbanter.com/excel-programming/336656-pivot-table-events.html)

Blue Aardvark

Pivot Table Events
 
Is there any way to run some code before a pivot table automatically updates?
Unlike query tables, there seems to be no exposed events for the pivot table
object.

Thanks.

Tom Ogilvy

Pivot Table Events
 
In excel 2002 and 2003 (I believe 2002 was where they were added), there are
some pivottable associated events, but they belong to the application,
workbook and worksheet objects. You can go to the object browser and search
on pivot, then scroll through the results looking for the lightning bolt
icon signifying an event.

--
Regards,
Tom Ogilvy

"Blue Aardvark" wrote in message
...
Is there any way to run some code before a pivot table automatically

updates?
Unlike query tables, there seems to be no exposed events for the pivot

table
object.

Thanks.




Blue Aardvark

Pivot Table Events
 
There seems to be 3 pivot table events. An open and close connection event
and an after update one. However, I need to capture an event before the
connection occurs.
I am querying another excel workbook and need to test if the file is open
before I connect to the source. If it is open, I am saving a copy to the
local disk and changing the connection to query the saved file instead. (All
because ADO can't cope with querying open workbooks.)
Any suggestions on how to capture the event would be appeciated.

Tom Ogilvy

Pivot Table Events
 
I would think, if there is no before update event, you would need to
eliminate any way to update the table except by using some button that you
provide (and the code associated with that button).

Worksheets(1).PivotTables("Pivot1") _
.PivotCache.EnableRefresh = False



--
Regards,
Tom Ogilvy


"Blue Aardvark" wrote in message
...
There seems to be 3 pivot table events. An open and close connection event
and an after update one. However, I need to capture an event before the
connection occurs.
I am querying another excel workbook and need to test if the file is open
before I connect to the source. If it is open, I am saving a copy to the
local disk and changing the connection to query the saved file instead.

(All
because ADO can't cope with querying open workbooks.)
Any suggestions on how to capture the event would be appeciated.





All times are GMT +1. The time now is 09:42 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com