Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
609 views
in Technique[技术] by (71.8m points)

excel - How to check in VBA/.NET API if Power Query data refresh is completed?

Given: an excel file with PowerQuery queries. Some queries have checked option "Background query" and (for some reason) refresh operation for those queries wasn't completed (was cancelled?).

Goal: find out those queries with uncompleted refresh, like the one below:

PQ queries

I use .NET Excel API to access Excel process. Currently, I've found 3 objects of Workbook, that I'm digging into in search for solution:

  1. workbook.Queries returns collection of WorkbookQuery objects.
  2. workbook.Connections returns collection of heterogenous object. I filter only objects of type WorkbookConnection, since that's only what I'm interested in.
  3. workbook.Worksheets[i].ListObjects[j].QueryTable

I've examine them, but have not yet found anything that corresponds to desired "status" message one could see in the UI in the screenshot above.

Any ideas?

question from:https://stackoverflow.com/questions/65892151/how-to-check-in-vba-net-api-if-power-query-data-refresh-is-completed

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...