Data Protection Issues

Prevent Copying Power Query Queries in a Protected Excel Workbook

Algirdas JasaitisAlgirdas Jasaitis Nov 18, 2026 869 views

Question details

The user wants to prevent people from copying Power Query queries while retaining workbook protection.

Prevent Copying Power Query Queries in a Protected Excel Workbook
Product
Microsoft Excel Power Query
Device & OS
not provided
Scenario
A protected Excel workbook contains Power Query queries that should not be copied into another workbook.
Observed behavior
Users can copy Power Query queries even when workbook structure protection is enabled.
Before you start

Identify who needs to open the workbook and who should have access to its queries and source data. Check whether your organization provides SharePoint permissions or sensitivity labels.

Solution 1Recommended

Restrict access to the workbook and its data sources

Use file and source permissions to limit who can inspect the workbook's queries and retrieve confidential data.

Excel workbook structure protection is not a security boundary for Power Query definitions. People who can open the workbook may be able to inspect or copy its queries.

Encryption and sharing permissions control access to the file; they do not guarantee that an authorized user cannot copy a query.

1
Review workbook protection

In Excel, open the Review tab and check Protect Workbook to confirm that structure protection remains enabled.

2
Limit file sharing

If the workbook is stored in SharePoint or OneDrive, select the file and open Manage access. Remove unnecessary access and share it only with approved people.

3
Apply an available label

If your organization uses sensitivity labels, open Sensitivity in Excel and select an appropriate label configured to restrict access or encrypt the file.

4
Restrict source access

In the database, cloud service, or other source used by the queries, review its access-control settings and grant data access only to authorized accounts.

Restrict access to the workbook and its data sources
Protection has limits: VBA that clears copy mode may discourage ordinary copying, but macros can be disabled or bypassed. Do not rely on it to protect confidential queries.
Free Microsoft Office alternative

Use WPS Office for Everyday Spreadsheet Work

WPS Office is a free, lightweight alternative with a familiar interface and support for Microsoft Office formats, making it easier to move everyday spreadsheet work. It does not fix Excel's Power Query protection limitations.

Open and edit Microsoft Excel XLSX filesWork with spreadsheet results without distributing an Excel Power Query workbookUse a familiar interface for everyday document and spreadsheet tasksGet a free, lightweight Office alternative
microsoft office alternative - wps office

Frequently Asked Questions

Does Protect Workbook stop users from copying Power Query queries?

No. Review > Protect Workbook protects workbook structure, but it is not a security boundary for Power Query definitions.

Can I let users see results without giving them the queries?

Yes. Copy the needed result cells into a new workbook using Paste Special > Values, then check Data > Queries & Connections before sharing the new file.

Will encrypting an Excel workbook prevent an authorized user from copying a query?

No. Encryption can restrict who opens the file, but an authorized user who can open it may still be able to inspect or copy its queries.

Can VBA reliably block query copying?

No. VBA that clears copy mode can discourage ordinary copying, but users can disable macros or bypass the code. Use file and data-source permissions instead.