Forum Discussion
Getting data from current sheet not working with excel.CurrentWorkbook()
- 3 years ago
Is that table actually formatted as an Excel table (see https://support.microsoft.com/en-us/office/overview-of-excel-tables-7ab0bb7d-3a9e-4b56-a3c9-6c94334e492c)? That should be your first step. Once you have done that you will be able to connect to it using Excel.CurrentWorkbook(). For example, if you have a table in your workbook called MyTable, the following M code will return the data from it:
Excel.CurrentWorkbook(){[Name="MyTable"]}[Content]
Did you change the name of the worksheet with the data on? From your code it looks like Power Query is looking for sheets called MainRaw and T-1 Raw.
See https://blog.crossjoin.co.uk/2020/04/06/understanding-the-the-key-didnt-match-any-rows-in-the-table-error-in-power-query-in-power-bi-or-excel/ for more detail on this kind of problem.
- Anonymous3 years agoNot applicable
Thanks a lot for the reply, no I did not, so the sheet names are the same and they are not deleted either, I checked out this page, but since I made no changes, it is not solving that issue currently.
- cpwebb3 years agoMicrosoft Employee
Is the case the same though? Power Query is case sensitive, so "MainRaw" is not the same as "Mainraw". If that's not the problem, can you try creating a new Power Query query that connects to your current workbook and if that works, post the code here?
- Anonymous3 years agoNot applicable
It is the same case, there is no difference at all. The sheet name is MainRaw.