+ Reply to Thread
Results 1 to 15 of 15

Event "BeforeRefresh" for PivotTable

  1. #1
    Registered User
    Join Date
    09-30-2010
    Location
    msk, russia
    MS-Off Ver
    Excel 2010
    Posts
    8

    Unhappy Event "BeforeRefresh" for PivotTable

    Good day!

    The goal is to calculate the duration of updating process*of PivotTable. PivotTable can be updated by the button (Refresh) or by simple manipulation (tuning filters, for example). To get the time during which the PivotTable is being updated, you need to know the start time and the end time of the update. When updating is finished the event Worksheet_PivotTableUpdate is raised. But for beginning of the update there is no such events, like BeforeRefresh for QueryTable.

    Question: how to define the start of the updating process of*PivotTable?

    Excel 2007/2010, pivottable based on external sources (PivotCache.OLEDBConnection).

    I would be grateful for any idea! And even for the words - "you can not do that!"

  2. #2
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,984

    Re: Event "BeforeRefresh" for PivotTable

    Filters are different from Refresh, but there isn't an event for that (unless it's based on a querytable in your workbook). The only option I can think of would be to hook the Refresh button. Why do you need to do this?
    Everyone who confuses correlation and causation ends up dead.

  3. #3
    Registered User
    Join Date
    09-30-2010
    Location
    msk, russia
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Event "BeforeRefresh" for PivotTable

    I have a lot of Excel files with PivotTables inside. And i want to know how much time users spend for refresh each table. In fact any change of PivotTable structure (filtering,sorting,changing fields position) causing PivotCache refresh.

  4. #4
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,984

    Re: Event "BeforeRefresh" for PivotTable

    Using filters should not cause the cache to refresh.

  5. #5
    Registered User
    Join Date
    09-30-2010
    Location
    msk, russia
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Event "BeforeRefresh" for PivotTable

    In case of MSOLAP connection, Excel throw MDX query to SSAS on any change of filters. In status bar we will see 'running OLAP query (press Esc to cancel)'

  6. #6
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,984

    Re: Event "BeforeRefresh" for PivotTable

    Ah, well you didn't mention OLAP before.
    Either way, the answer is the same.

  7. #7
    Registered User
    Join Date
    09-30-2010
    Location
    msk, russia
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Event "BeforeRefresh" for PivotTable

    You are mistaken. When you change some filter:
    1. Excel throw MDX query to SSAS (SQL Profiler, in StatusBar you can see 'running OLAP query (press Esc to cancel)')
    2. PivotCache.RefreshDate changes to current time
    Test it

  8. #8
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,984

    Re: Event "BeforeRefresh" for PivotTable

    You misunderstood me. I meant that the answer to your problem is still no.

  9. #9
    Registered User
    Join Date
    09-30-2010
    Location
    msk, russia
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Event "BeforeRefresh" for PivotTable

    Oh, got it... sorry!

  10. #10
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,984

    Re: Event "BeforeRefresh" for PivotTable

    Just noticed...

    Your post does not comply with Rule 8 of our Forum RULES. Cross-posting is when you post the same question in other forums on the web. You'll find people are disinclined to respond to cross-posts because they may be wasting their time solving a problem that has been solved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser)to the cross-post. Expect cross-posts without a link to be closed a message will be posted by the moderator explaining why. We are here to help so help us help you!

    Read this to understand why we ask you to do this

  11. #11
    Registered User
    Join Date
    09-30-2010
    Location
    msk, russia
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Event "BeforeRefresh" for PivotTable

    Thanks for the clarification!

  12. #12
    Registered User
    Join Date
    09-30-2010
    Location
    msk, russia
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Event "BeforeRefresh" for PivotTable

    Maybe, is possible to catch any action on PivotTable? For example left mouse click on PivotTable? This would solve the problem.

  13. #13
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,984

    Re: Event "BeforeRefresh" for PivotTable

    You've only really got the worksheet events - Change, SelectionChange but I think the change event would be too late.

  14. #14
    Registered User
    Join Date
    09-30-2010
    Location
    msk, russia
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Event "BeforeRefresh" for PivotTable

    Yeah... The standard solution is not suitable...

  15. #15
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,984

    Re: Event "BeforeRefresh" for PivotTable

    I think you're out of luck then, I'm afraid.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1