



August 21, 2019

Hi,
I was amazed by the M code Excel.CurrentWorkbook( ) that allow us to append several worksheets easily, without using Append query in PQ editor
Is there any equivalent M code for bringing in worksheets from various sources ( D drive, server drive) into Power Query, without bringing in the physical tables ( or minimally) into one single query just like Excel.CurrentWorkbook( )
for e.g.
I open a new workbook, open a blank query at formula bar key in equivalent M code to bring in PC_1 ad PC_2 tables from the attach
Thank you !


August 21, 2019

Hi Catalin,
I try to explain,,
in my attached example, because the source file is in the excel itself, I can use =Excel.CurrentWorkbook( ) in the blank query and that it
what if I open up a blank excel workbook, open a blank query, you mean I can use =File.Contents( d:\temp\file.xlsx) to import in ?


November 8, 2013

Hi Chris,
Attached is an example, you can use that, or start with a blank query with this formula:
= Excel.Workbook(File.Contents("C:\Users\Catalin\Desktop\New folder\SourceTable.xlsx"), null, true)
This will give you the list of sheets in that workbook, you can select the ones you want and expand the data table.
As mentioned, I only used File.Contents() and Excel.Workbook() to extract data from the file.
Nothing is stopping you from trying, I think trying things is the best way to go, even if it fails sometimes.


August 21, 2019

Hi Catalin, perfect ! this is exactly what I am looking for, however some users still like to import all the tabs into PQ and append it
so I thought by just writing this short code ( thanks to you !!)
= Excel.Workbook(File.Contents("C:\Users\JO_HOME\Downloads\temp\ExcelCurrentWorkbook.xlsx"), null, true)
it is clean, light and display what I want, the master combined dataset
Chris Yap
1 Guest(s)
