如何在VBA连接刷新错误中获取PowerQuery错误消息?

时间:2018-02-09 16:29:38

标签: excel powerquery

Excel 2016

使用WorkbookConnection.Refresh

捕获错误

但它捕获的错误没有相同的细节水平,就像我直接从PowerQuery刷新它并看到GUI中的错误一样。 我得到的是“1004应用程序定义的或对象定义的错误”。 无法看到对象模型中的哪个位置可以获取查询特定的或OLEDB错误。 是否有人能够捕获任何更具体的错误消息。

此代码引发错误: -

Assume higher level loop iterating connections
Dim cno As WorkbookConnection
Set cno = ThisWorkbook.Connections(cn)
cno.Refresh

ErrorHandler down here capturing the error 

0 个答案:

没有答案