Hi
I currently have the M code below that queries a Workbook called Budget.xlsm. I want to change that to query the workbook that the query sits in - for instance Book1.xlsm
I guess I will use the M Code Excel.CurrentWorkbook but I don't know how to replace the File.Contents portion of the Code if I was to use Excel.CurrentWorkbook.
Can someone advise how I would change eth code to refer to the current workbook?
Allister
let
Source = Excel.Workbook(File.Contents("S:\Budget.xlsm"), null, true),
#"Filtered Rows3" = Table.SelectRows(Source, each ([Kind] = "Sheet")),
#"Filtered Rows1" = Table.SelectRows(#"Filtered Rows3", each Text.StartsWith([Name], "bd")),
#"Expanded Data" = Table.ExpandTableColumn(#"Filtered Rows1", "Data", {"Column1", "Column2", "Column3"})
in
#"Expanded Data"
Bookmarks