I am trying to find the name and full path of the current excel file where the power query is run. I dont need the filename as such, its just that I want to have access to a sheet which do not have any data table, rather raw data is there.
When I try the Excel.CurrentWorkbook()
it only gives a list of tables in the current workbook. But when I try to access the file using its name and full path using File.Contents()
then all the sheet objects are returned which includes the sheets that contain raw data (without being converted into a data table).
So my plan is, if I could get the file name and path of the current workbook, then I can use it to access the sheet. I cant hardcode the file name as it gets changed everyday with the date as suffix.
Is there any other way around it?