QueryTable:如何获取VBA中的“读取数据”值

我正在构build一个VBA应用程序,并且与SQL数据库的连接速度非常慢。 要通知用户我想在状态栏中显示进度百分比的进度。

到目前为止,我已经注意到,Excel本身显示状态栏中读取数据行的数量。 看到 Excel的阅读数据

我的问题是:如何检索该值显示我自己的进度栏?

显然,我可以设置查询到后台,并监视刷新状态,但我从哪里得到的数据:

Set listObj = destinationSheet.ListObjects.Add(SourceType:=0, Source:=Array( _ "OLEDB;Provider=SQLOLEDB.1;" & _ "Network Library=DBMSSOCN;" & _ "Persist Security Info=False;" & _ "User ID=" & sqlUser & _ ";Password=" & sqlPassword & _ ";Data Source=" & sqlServerName & _ ";Initial Catalog=" & sqlDatabaseName), _ Destination:=destinationRange) With listObj.QueryTable 'Some other code here .Refresh BackgroundQuery:=True While .Refreshing Application.StatusBar = "What now?" 'How to get the Reading Data value Wend End With