I have a problem where I have to change the Power Query data source when a specific error occurs in my code. Basically my code needs to perform the following:
If no error, then refresh using "Default data source". If Error, then perform query to "Modified Data Source".
In total, I have 8 queries but 7 of them are joined to the "main query" and therefore the main query is dependent on the 7 queries. All 8 queries have the 1st step in Power Query:
Excel.Workbook(File.Contents("FILE PATH"), null, true)
How do I change the "FILE PATH" to "FILE PATH 2" by using VBA?
Thanks for the help!