I'm having this piece of code in Excel Power BI for an external datasource (webpage) from which I want to get some data (specific exchange rate).
In it self, it works. But whenever the site goes down, I'll end up with an annoying pop-up in Excel telling me some Datasource.Error occured while periodically updating my query. I'd like to get rid of that.
I'm not a programming wizard at all, just copying/pasting bits and pieces from wherever I find them on the internet, meanwhile trying to learn something.
But I think I need to handle the response code on the Web.Contents call, by adding the optional parameter [ManualStatusHandling={401,403,404}] to the call. Another option might be to put a try-construction in, although the exact status handling would be neater. Can somebody please help me out and show me what the code should look like to properly handle this (or some other) status that might occur, so it does nothing when the mentioned statusses occur and otherwise picks up the data?
Bookmarks