A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
Thanks Franz
I'll give it a try.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I've just installed the latest Power Query (PQ) update which allows you to add parameters to your queries, and I'm trying to set up a query where I can pass the name of an Excel file (the query source) to the query's SOURCE = Excel.Workbook(File.Contents("file path and name"), null, true) statement.
I've set up my parameter - called FilePathAndName, set to "C:\users\myname\Data.XLSX" - and set up the SOURCE statement as
Source = Excel.Workbook(File.Contents(FilePathAndName), null, true) via the advanced editor, but all I get is a summary of the sheet names from the source file.
The data file has 2 sheets, with the one to be imported called DATASET1.
It seems I'm almost there, but must be missing something.
Hopefully someone has figured this out already, given this added functionality to PQ I think is pretty new.
Thanks in advance !
A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
Thanks Franz
I'll give it a try.
I've just installed the latest Power Query (PQ) update which allows you to add parameters to your queries, and I'm trying to set up a query where I can pass the name of an Excel file (the query source) to the query's SOURCE = Excel.Workbook(File.Contents("file path and name"), null, true) statement.
I've set up my parameter - called FilePathAndName, set to "C:\users\myname\Data.XLSX" - and set up the SOURCE statement as
Source = Excel.Workbook(File.Contents(FilePathAndName), null, true) via the advanced editor, but all I get is a summary of the sheet names from the source file.
The data file has 2 sheets, with the one to be imported called DATASET1.
It seems I'm almost there, but must be missing something.
Hopefully someone has figured this out already, given this added functionality to PQ I think is pretty new.
Thanks in advance !
Once you have the list of all sheets, you have to filter in order that only the relevant sheet remains. Then you can expand the table in order that you can work on your data.
Hope it helps.
Regards
Franz