Change the Source Workbook in Excel Power Query
Question details
Change the Excel workbook used by an existing Power Query without recreating its transformations.

- Product
- Microsoft Excel Power Query
- Device & OS
- not provided
- Scenario
- An existing query needs to read from a different Excel workbook while retaining its transformation steps.
- Observed behavior
- The user wants the existing query to use the new workbook rather than create a separate query and repeat the transformations.
Locate the full path of the new workbook and check that it contains the sheet or table names and columns used by the existing query. Different names or structures may require changes to later query steps.
Change the workbook path in Advanced Editor
Use this method to edit the source path directly in the existing query and keep its transformation steps.
In Excel, select Data > Queries & Connections, then double-click the existing query to open Power Query Editor.
Select Home > Advanced Editor. Find the workbook path in the Excel.Workbook(File.Contents(...)) source expression and replace it with the full path to the new workbook, keeping the quotation marks.
Select Done, then review Applied Steps and the data preview. If a step reports an error, check that the referenced sheet or table and columns exist in the new workbook.
Select Home > Close & Load to apply the change to the existing query, then refresh it if needed.

Change the workbook through Data Source Settings
Use Data Source Settings to select a replacement workbook without editing the query code.
Work with Excel workbooks in WPS Spreadsheets
WPS Office is a free, lightweight alternative with a familiar spreadsheet interface and support for Excel formats, making it easier to move everyday workbook editing to WPS. Changing an existing Microsoft Power Query source should still be done in Excel.

Frequently Asked Questions
Will changing the source path delete my Power Query steps?
Changing the path in Home > Advanced Editor or through Data Source Settings keeps the existing steps. However, steps may need adjustment if the new workbook has different sheet, table, or column names.
Why did I get a second query when I chose New Source?
New Source can create a separate query. To update the original query instead, open it from Data > Queries & Connections and change its source path in Advanced Editor or Data Source Settings.
What if the new workbook has a different sheet name?
In Power Query Editor, check the Navigation step under Applied Steps. Update the sheet or table reference to match the new workbook, then review later steps for column differences.
What should I do if Power Query asks for credentials after the change?
Follow the credentials prompt for the new source, or open File > Options & Settings > Data Source Settings in Power Query Editor to review its permissions.




