We have an Excel file which is connected to a postgres database via PowerQuery.

PowerQuery needs npgsql provider for it. When I open file locally on my computer and try to update data - everything is ok.

When I open this excel file in Web App in SharePoint and try to do the same, an error occurs, which ehas no information in the SharePoint ULS logs about it. enter image description here

I have tried to install npgsql provider on the SharePoint server and added it to Trusted data providers with no result.

So what should I do for resolve the issue? Is it possible?

Or maybe is there another way to connect an Excel file located in SharePoint to Postgres, which I do not know?

1 Answer 1


After weeks of googling and days of waiting for an answer I've wrote my own solution.

I've used C#, SharePoint.Client and Interoop libraries for Office and Excel.

If you need to update external connections in Excel files (not only PowerQuery) feel free to use it - I've published it on GitHub


  1. Open local instance of Excel
  2. Open workbook from SharePoint
  3. Save it locally in temp file (otherwise file can not be changed, because it is in read only mode)
  4. Refresh all connections in file
  5. Save it again
  6. Publish back to SharePoint site
  7. Delete temporary file
  8. Go to 2. if there are other files to update. Else 9
  9. Close Instance of Excel

There are some issues with authentication, which I described in repository readme file. And it is not best approach, but it works.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.