Can Excel Power Query Store Database Credentials in a Workbook?
Question details
The user wants to share an Excel workbook that runs Power Query database queries without distributing database usernames and passwords.

- Product
- Microsoft Excel Power Query and Microsoft SQL Server Express 2016
- Device & OS
- not provided
- Scenario
- An organization shares a workbook containing queries that execute SQL Server stored procedures on multiple computers.
- Observed behavior
- Power Query asks for database authentication again when the workbook is opened on another computer.
Confirm that the other computer can reach the SQL Server Express instance and that the user has permission to run the required stored procedures. Ask the database administrator which authentication methods are supported.
Configure Power Query Credentials on Each Computer
Use Data Source Settings to authorize the workbook's database connection on each computer where it will be refreshed.
Power Query does not securely embed reusable database credentials in the workbook. Credentials must be configured for the user or environment that runs the queries.
On the other computer, open the workbook in Excel and select Data > Get Data > Data Source Settings.
Under Data sources in current workbook, select the SQL Server connection and choose Edit Permissions.
Under Credentials, select Edit, choose the authentication method approved by your administrator, and enter the required information.
Select Data > Refresh All and confirm that the queries can run the required stored procedures.

Use Windows Authentication for Organizational Access
If SQL Server and the organization support it, use approved Windows identities instead of distributing a shared database password.
Work With Excel Workbooks in WPS Office
WPS Office is a free, lightweight alternative with a familiar spreadsheet interface and Microsoft Office format compatibility for an easier move between office suites. It does not change Excel Power Query credential handling; verify advanced query compatibility before migrating a workbook.

Frequently Asked Questions
Can I save a SQL Server password inside an Excel workbook for other users?
Power Query does not support securely embedding reusable database credentials in the workbook. Configure credentials through Data > Get Data > Data Source Settings on each computer, or use an approved organizational authentication method.
Why does Power Query ask for credentials on another computer?
The workbook contains connection and query information, but the locally configured credentials do not travel with it. The other user must configure an approved authentication method for the data source.
Can Windows authentication avoid sharing a database password?
Yes, if SQL Server and the organization's network support it. An administrator must grant the users' Windows identities access, after which users can choose Windows in the data source's credential settings.
Will a gateway let Excel Desktop refresh without credentials?
Not automatically. A gateway can support centralized access through compatible services, but it is not a general replacement for configuring an Excel Desktop connection. Ask your administrator whether a supported service-based architecture fits the workflow.




