I have created multiple Excel sheets for my coworkers, many of which involve power query connections to our corporate SharePoint site. When I set it up, I logged into my SharePoint account to authenticate.
The reports refresh for me easily. However, when I send the file to somebody else, and they try to refresh it, they get an "Exception of type 'Microsoft.Mashup.Engine.INterface.ResourceAccessForbiddenException' was thrown" error. They can resolve it by going into power query, data source settings, edit permissions, then choosing "organizational account" instead of "anonymous". once they do that, it works forever.
THe problem is, I have a lot of users. Is there a way to make my queries in such a way that it prompts them to login rather than just throwing an exception? I want them to be able to refresh the reports without having to go into power query, which many of them cannot do without support.
I'm not looking for it to save the password in the file or anything like that - users definitely need to login with their own account, I just want it to remember to use "organizational" authentication instead of "anonymous" by default.
The issue seems to be the same as the one referenced here: https://social.technet.microsoft.com/Forums/en-US/b5ea5742-db99-4507-9844-e4a3a36c67df/excel-power-query-anonymous-credentials?forum=powerquery (where no solution is provided).