Consulting

Results 1 to 5 of 5

Thread: PowerQuery refresh / Pivot Table refresh

  1. #1
    VBAX Regular
    Joined
    Jun 2008
    Posts
    70
    Location

    PowerQuery refresh / Pivot Table refresh

    I'm having a problem where my VBA code refreshes my PowerQuery query and then refreshes the pivot table that uses the query results.

    Problem is the vba code does not wait until the PQ refresh is complete. So my pivot table refreshes before the new data is available.

    Is there a solution to this other than Application.Wait ? The Enable Background refresh is unchecked but that makes no difference.

  2. #2
    VBAX Master Aflatoon's Avatar
    Joined
    Sep 2009
    Location
    Not far
    Posts
    1,537
    What is your code?
    Be as you wish to seem

  3. #3
    VBAX Regular
    Joined
    Jun 2008
    Posts
    70
    Location
     With ThisWorkbook        
        Set ptFees = shtptFees.PivotTables("PTFees")
        .Connections("Query - tblProducers").Refresh
        ptFees.PivotCache.Refresh
    End With

  4. #4
    VBAX Master Aflatoon's Avatar
    Joined
    Sep 2009
    Location
    Not far
    Posts
    1,537
    Are you building pivots directly off the PQ data, or is PQ dropping the data into a table, and you then pivot off that table?
    Be as you wish to seem

  5. #5
    VBAX Regular
    Joined
    Jun 2008
    Posts
    70
    Location
    The PQ data is loaded directly into a PT.

Posting Permissions

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