Forum Discussion

han_rj's avatar
han_rj
Helper IV
1 year ago
Solved

Excel.currentworkbook() not working shows no tables

Hi All,   I have a Excel workbook to load in Power Query using Excel.CurrentWorkbook() fuction but this does not return any result.Please may I have help correct me.        
  • v-sgandrathi's avatar
    v-sgandrathi
    1 year ago

    Hi han_rj,

    Thank you for being a part of Microsoft Fabric Community Forum!

    Excel.CurrentWorkbook() is designed for use inside an Excel workbook’s own Power Query environment. It returns tables and named ranges within the same Excel file.

    In Power BI Desktop, there is no “current workbook” concept. The .PBIX is not the same as an Excel workbook. So, calling Excel.CurrentWorkbook() from within a .PBIX will simply return an empty result or error because Power BI has no reference to an Excel workbook in memory.

    Instead of using Excel.CurrentWorkbook(), select Get data, Excel workbook and choose your .xlsx file.
    This is the most straightforward way to load Excel data into Power BI.

    If this solution worked for you, kindly mark it as Accept as Solution and feel free to give a Kudos, it would be much appreciated!

     

    Regards,
    Sahasra.