PowerQuery would scan the contents of all the files in the directory listed below and only provide the values for the first row of data, which is likely to contain the names of your column headings. It contains the file and tab names.
let Source = Folder.Files("C:\subdirectory\directory"),
#"Filtered Rows" = Table.SelectRows(Source, each ([Extension] = ".xlsx")),
#"Removed Other Columns" = Table.SelectColumns(#"Filtered Rows",{"Name", "Content"}),
#"Added Custom" = Table.AddColumn(#"Removed Other Columns", "GetFileData", each Excel.Workbook([Content],true)),
#"Expanded GetFileData" = Table.ExpandTableColumn(#"Added Custom", "GetFileData", {"Data", "Hidden", "Item", "Kind", "Name"}, {"Data", "Hidden", "Item", "Kind", "Sheet"}),
#"Added Custom1" = Table.AddColumn(#"Expanded GetFileData", "Data2", each Table.FirstN(Table.DemoteHeaders([Data]),1)),
List = List.Union(List.Transform(#"Added Custom1"[Data2], each Table.ColumnNames(_))),
#"Expanded Data" = Table.ExpandTableColumn(#"Added Custom1", "Data2", List,List),
#"Removed Columns" = Table.RemoveColumns(#"Expanded Data",{"Content", "Data", "Hidden", "Item", "Kind"})
in #"Removed Columns"