Forum Discussion

SAI-Indy's avatar
SAI-Indy
Copper Contributor
Apr 25, 2019

Excel Power Query Refresh fails for a shared file owner on SharePoint using Office 365 Business Prem

I have recently generated several Excel spreadsheets on our office 365 sharepoint drive.  I use Power Query in Excel to manipulate data and generate Pivot reports in the excel spreadsheets.  All references to the excel spreadheets use web links and not local drive directories.  All of the files have been shared with a co-worker.  While the co-worker can sync the files locally to their machine and open the files, they cannot refresh the data.  My co-worker receives the following error: [Exception of type "Microsoft.Mashup.Engine.Interface.ResourceAccessForbiddenException" was thrown].  We are both using our Organization Account credentials to access the data source.  I suspect that this is where the issue is originating, but looking for a workaround, since we both need to access, edit and refresh the excel files and the corresponding power queries.

4 Replies

  • SergeiBaklan's avatar
    SergeiBaklan
    Diamond Contributor

    SAI-Indy , how exactly do you reference files on SPO? Correct query is like

     

    Sharepoint.Files(<root site URL>) 
    Filtrer file by name 
    Get binary content 
    Get object from file (table or sheet)

    • SAI-Indy's avatar
      SAI-Indy
      Copper Contributor

      SergeiBaklan 

       

      Here' the general flow:

      1a) SharePoint.Files("https://mydomain.sharepoint.com/sites/Commissions/", [ApiVersion = "Auto"]))

      or

      1b) SharePoint.Files("https://mydomain.sharepoint.com/sites/Commissions/myfilename.xlsx")

      2) Filter files by name (for option 1a above)

      3) GetExcelObjects (filter by kind=sheets)

      4) Expand tables

      5) ...manipulate data

Resources