Using VBA to update power query I keep running into Query updating issues on protected sheets any Ideas on solutions?
When the sheet is protected, I get "Download did not complete".
The query says "you cannot edit a query that has been loaded to a protected worksheet"
When the sheet is Unprotected, the code runs without issue.
Under Data>Properties, Enable Background refresh is unchecked.
Here is the Code:
Sub Memolookup()
Sheets("Memo Look Up").Unprotect Password:=""
ThisWorkbook.Connections("Query - Memo Lookup").OLEDBConnection.refresh
Range("E4") = Range("B8").Value
Range("E5") = Range("C8").Value
Sheets("Memo Look Up").Protect Password:=""
End Sub
When the sheet is protected, I get "Download did not complete".
The query says "you cannot edit a query that has been loaded to a protected worksheet"
When the sheet is Unprotected, the code runs without issue.
Under Data>Properties, Enable Background refresh is unchecked.
Here is the Code:
Sub Memolookup()
Sheets("Memo Look Up").Unprotect Password:=""
ThisWorkbook.Connections("Query - Memo Lookup").OLEDBConnection.refresh
Range("E4") = Range("B8").Value
Range("E5") = Range("C8").Value
Sheets("Memo Look Up").Protect Password:=""
End Sub