Check if refreshing data in pivot table was finished RRS feed

  • Question

  • Hello guys, 

    This is my first post here so forgive if I'm asking in wrong place. 

    Maybe you can help me or give me some hint how can I check if data in pivot tables refresh event was finished.

    So I'm using excel plugin that allows to load excel spread sheets from external source e.g application server,

    in this reports there are define some pivot tables with olap connections. When report is opened data is automatically refreshed,

    what I'm trying to do is somehow check if this refresh was finished and start manipulating data in c# but I'm not able to check

    if refresh was finished or it's still going.

    I found that query table has refreshing flag which indicates if some query is running. But I'm not able to get to querytable object or  to listobjects object, I'm using excel 2013 and only when I added sql database connection to sheet there was value in listobject object but still querytable was empty, 

    What I'm doing wrong ? 

     public void refrestTest()
                 Excel.Sheets  test= excelApp.ActiveWorkbook.Worksheets;
                foreach (Excel.Worksheet displayWorksheet in test)
                    if (displayWorksheet.ListObjects.Count > 0)
                        var pp1 = displayWorksheet.ListObjects.get_Item(1).QueryTable.Refreshing;



    • Edited by Lukas Yabol Wednesday, February 11, 2015 8:47 PM
    • Moved by George123345 Thursday, February 12, 2015 3:07 AM
    Wednesday, February 11, 2015 8:47 PM

All replies

  • Hi,

    This is the forum to discuss questions and feedback for Microsoft Excel, I'll move your question to the MSDN forum for Excel

    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.

    George Zhao
    TechNet Community Support

    It's recommended to download and install Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office programs.
    Thursday, February 12, 2015 3:07 AM