As long as the structure of the sheets is constant, you should be able to import them by sheet index. Explained here Import first sheet of an Excel workbook into Power Query, regardless of its name
Hello, I have a query from a Folder that has three excel files. The query works, but only if all the .xls files have the same worksheet name.
I will likely have many files over time in the Folder & don't want to have to change it every time.
Does anyone know how I can change the query function to get around this worksheet reference?
As long as the structure of the sheets is constant, you should be able to import them by sheet index. Explained here Import first sheet of an Excel workbook into Power Query, regardless of its name
Could you post the M-code?
Yes, but after that first file import is done, of the first worksheet, it seems to append the Source to worksheets of that name, and if other files worksheet names are different than that, then it creates an error for (only) those files.
I've attached a screenshot of (at least my issue).
Are you saying that happened AFTER you had made the change to import by index number?
Bookmarks