Power Query Problems

Refresh an Excel PivotTable When the Source Workbook Is Open

Phi Hung VoPhi Hung Vo Dec 2, 2026 869 views

Question details

Refresh an Excel PivotTable that uses an external workbook as its source while the source data is being edited.

Refresh an Excel PivotTable When the Source Workbook Is Open
Product
Microsoft Excel Power Query and PivotTable
Device & OS
not provided
Scenario
A PivotTable or Power Query connection reads data from a separate Excel workbook that needs to remain open for editing.
Observed behavior
Refreshing the connection can produce a file-in-use or DataSource.Error message while the source workbook is open.
Before you start

Check whether the PivotTable reads from an external workbook through Power Query and identify the source file. Confirm whether the PivotTable must remain in a separate workbook or can be created alongside the source data.

Solution 1Recommended

Create the PivotTable in the Source Workbook and Use Two Windows

Use this workaround when you need to display a PivotTable while editing its source data.

A PivotTable based directly on a table in the same workbook avoids the external-file read that may cause the error. The two windows show the same workbook, so changes in either window affect the same file.

1
Create a source table

Open the source workbook, select the data, and choose Insert > Table. Confirm the range and whether it has headers.

2
Insert the PivotTable

Select a cell in the table, choose Insert > PivotTable, and create the PivotTable in the same workbook. Add the fields you need to the PivotTable.

3
Open a second window

Choose View > New Window. In one window, display the source table; in the other, display the PivotTable.

4
Edit and refresh

Edit the source table in one window, then switch to the PivotTable window, right-click the PivotTable, and select Refresh.

Create the PivotTable in the Source Workbook and Use Two Windows
Using Power Query transformations: A PivotTable built directly from the source table will not automatically reproduce transformations from the original Power Query. Recreate any required transformations before relying on the new PivotTable.
Free Microsoft Office alternative

Work with Spreadsheet Data and PivotTables in WPS Office

WPS Office is a free, lightweight alternative with a familiar spreadsheet interface and Microsoft Office format compatibility for easier migration. It does not resolve Excel Power Query file-lock errors, and existing queries should be tested before migrating.

Create PivotTables to summarize spreadsheet dataOpen and edit Microsoft Excel XLSX and XLS filesUse a familiar spreadsheet interfaceWork with a free, lightweight office suite
microsoft office alternative - wps office

Frequently Asked Questions

Why does Power Query show a file-in-use error when I refresh?

Power Query may be unable to read an external workbook while it is open for editing by another process. Save and close the source workbook, then use Data > Refresh All in the destination workbook.

Can I edit the source data and show the PivotTable at the same time?

Yes. Create a PivotTable directly from a table in the source workbook, then choose View > New Window. Show the data in one window and the PivotTable in the other, and refresh the PivotTable after editing.

Will a PivotTable update automatically when I change its source data?

Not necessarily. After editing the source table, right-click the PivotTable and select Refresh, or use Data > Refresh All.

Does closing the source workbook preserve my latest edits for refresh?

Save the source workbook with File > Save before closing it. The external connection can then read the saved version when you refresh the destination workbook.