PDA

View Full Version : PowerQuery first sheet in workbook



fb7894
08-30-2018, 12:10 PM
Hello. Is there a way I can tell PowerQuery to open a workbook and use the first sheet as the source?

In VBA, we would say wb.worksheets(1)

Is there an equivalent in PQ?

horseyride2
01-08-2019, 06:59 AM
let Source = Excel.Workbook(File.Contents("c:\temp\a.xlsx")),
Data = Source{[Item=Source{0}[Name],Kind="Sheet"]}[Data]
in Data