Excel PowerQuery System.EnterpriseServices Impersonation Level is Invalid
Posted May 11, 2022 at 4:06 PM MDT byRecently a user encountered the following error message when refreshing a query in Excel that used PowerQuery to connect to Microsoft SQL Server using Windows authentication:
Could not load file or assembly ‘System.EnterpriseServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’ or one of its dependencies. Either a required impersonation level was not provided, or the provided impersonation level is invalid. (Exception from HRESULT: 0x80070542)
What’s going on? Read on for all the gory details.
Spoiler: The problem was caused by attempting to “Use alternate credentials” for Windows authentication in PowerQuery. It was solved by switching to “Use my current credentials” in Data Source Settings, as described in “Manage data source credentials” in Manage data source settings and permissions (Power Query).
Read more...