Forum Discussion
Excel Power Query Connecting to Datasource locks up all Office products
- 8 months ago
Hi masplin ,
You don’t need to create a separate function for the delay. Just modify your existing QuoteUK/Yahoo function by wrapping the Web.Contents call with Function.InvokeAfter. In the earlier example, x was only a placeholder argument, it's not meant to be your function name.
Here’s how your function should look once the delay is applied:
let
Url = "https://shareprices.com/lse/" & Yahoo & "/",Source =
Function.InvokeAfter(
() =>
Web.Page(
Web.Contents(
Url,
[
Headers = [
#"User-Agent" = "Mozilla/5.0 (Windows NT 10.0; Win64; x64)",
Accept = "text/html",
#"Accept-Language" = "en-GB,en;q=0.9"
]
]
)
),
#duration(0,0,0,1)
)
in
Source
Hope this helps,
Thank you.
I am unclear how I put the delay around my funtion? Do I create a new function where x= old function name
(QuoteUK as text) =>
let
_ = Function.InvokeAfter(() => QuoteUK, #duration(0,0,0,1)),
result = Web.Contents(QuoteUK)
in
result
Or am i editiing my QuoteUK function in some way
(Yahoo as text) as table =>
let
Source = Web.Page(Web.Contents("https://shareprices.com/lse/"&Yahoo&"/",
[
Headers = [
#"User-Agent" = "Mozilla/5.0 (Windows NT 10.0; Win64; x64)",
Accept = "text/html",
#"Accept-Language" = "en-GB,en;q=0.9"
]
])),
Much appreciated any advice
Hi masplin ,
You don’t need to create a separate function for the delay. Just modify your existing QuoteUK/Yahoo function by wrapping the Web.Contents call with Function.InvokeAfter. In the earlier example, x was only a placeholder argument, it's not meant to be your function name.
Here’s how your function should look once the delay is applied:
let
Url = "https://shareprices.com/lse/" & Yahoo & "/",
Source =
Function.InvokeAfter(
() =>
Web.Page(
Web.Contents(
Url,
[
Headers = [
#"User-Agent" = "Mozilla/5.0 (Windows NT 10.0; Win64; x64)",
Accept = "text/html",
#"Accept-Language" = "en-GB,en;q=0.9"
]
]
)
),
#duration(0,0,0,1)
)
in
Source
Hope this helps,
Thank you.