How to Share an Excel Database Connection Securely
Question details
The user wants to share an Excel workbook containing linked database tables without losing the connection configuration or compromising database credentials.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- Sharing an Excel file with database connections among multiple users who may or may not have their own database permissions.
- Observed behavior
- Saved credentials do not transfer automatically, causing connection failures for recipients, and manually saving credentials for every user is impractical and poses security risks.
Verify your organization's security policies regarding database access and ensure that intended recipients have the necessary permissions before sharing connection details.
Prompt Users for Credentials via Power Query
Configure Power Query to require users to enter their own credentials, ensuring secure, individualized database access.
This method is ideal when each user has their own database permissions. It prevents the need to embed sensitive passwords in the shared file.
Open your Excel workbook, navigate to the 'Data' tab on the ribbon, and click 'Get Data' followed by 'Data Source Settings'.
Select your active database connection from the list and click the 'Edit Permissions' button.
Under the Credentials section, click 'Edit', clear any saved login details, and set the privacy level to match your organizational requirements. Click 'Save' and 'OK'.
Save and distribute the workbook. When recipients click 'Refresh All', Excel will prompt them to authenticate with their own database credentials.

Distribute an Excel Template (.xltx)
Save the configured workbook as a template so users can generate fresh files with pre-configured connection strings.
Export an Office Data Connection (.odc) File
Separate the connection properties from the workbook by using an ODC file, allowing centralized management.
Try WPS Office for Secure Data Management
If you are experiencing issues managing complex database connections in Microsoft Excel, consider WPS Office. It provides a lightweight, free alternative with high compatibility for standard spreadsheet formats.

Frequently Asked Questions
What is an ODC file in Excel?
An Office Data Connection (.odc) file stores connection information to external data sources. It allows users to share standard database connection strings without having to embed them directly into individual workbooks.
Why do other users get a connection error when opening my shared Excel file?
If 'Save password' is disabled or credentials are not shared alongside the file, Excel requires each user to authenticate. They must have their own database permissions or be provided with a secure connection template to access the linked tables.
How do users create a new file from an Excel template (.xltx)?
Users simply double-click the .xltx file from their file explorer. Excel automatically generates a new, unsaved workbook (typically named Document1) that retains all the data connections, formatting, and formulas without altering the original template file.




