我正在尝试更新受保护工作表上的Power Query连接。但是,当我尝试调用connections_upd时,我不断收到错误400。
Private Sub workbook_open()
Dim ws As Worksheet
Const Pwd = "123"
For Each ws In Worksheets
With ws
.Protect Password:=Pwd, AllowFiltering:=True, UserInterfaceOnly:=True
End With
Next ws
End Sub
Private Sub connections_upd()
For Each objConnection In ThisWorkbook.Connections
objConnection.Refresh
Next
End Sub
您能帮我解决这个问题吗?