Forum Discussion
Change Source = Excel.CurrentWorkbook() name sheet
- 6 years ago
Hi cristianml ,
You'll need something like this to get the sheet names and then navigate to the specific sheet you need.
From what I understand you can't acheive this using Excel.CurrentWorkbook().
let Source = Excel.Workbook(File.Contents("YourFilePath"), null, true), #"Filtered Rows" = Table.SelectRows(Source, each ([Kind] = "Sheet")), #"This Sheet_Sheet" = #"Filtered Rows"{[Item="This Sheet",Kind="Sheet"]}[Data] in #"This Sheet_Sheet"Hope this helps point you in the right direction.
Regards,
Kim
Hi cristianml ,
You'll need something like this to get the sheet names and then navigate to the specific sheet you need.
From what I understand you can't acheive this using Excel.CurrentWorkbook().
let
Source = Excel.Workbook(File.Contents("YourFilePath"), null, true),
#"Filtered Rows" = Table.SelectRows(Source, each ([Kind] = "Sheet")),
#"This Sheet_Sheet" = #"Filtered Rows"{[Item="This Sheet",Kind="Sheet"]}[Data]
in
#"This Sheet_Sheet"
Hope this helps point you in the right direction.
Regards,
Kim
Hi KNP ,
thanks ! works perfect ! now I like to solved the other part that is change the path so when i share the file to other user can use it without change the hardcoded path:
File.Contents("C:\Users\cristian\Desktop\Actual vs Forecast\Macro Actual vs Forecast.xlsm")
but I will try this with filepath from cell value. 🙂
Thanks !!