Forum Discussion

Simon_29's avatar
Simon_29
Helper II
4 years ago
Solved

problem with Power Query updating new data from named file

Hello,

I have a problem with Power Query updating new data. I found a function that works by typing the name and path of the folder I want to load into Power Query into a cell in Excel. I created such a cell + cell where I enter the path to this file. I pasted the code into the "Advanced Editor". And it always worked. However, now after a long time I have inserted a new file in that folder and when I refresh it completely I get this error and the wrong data is inserted into "Item = ...". For some reason, it doesn't take the folder name I gave but creates its own. Can anyone advise me on this problem please?

Thank you very much I'm sending screenshots of errors and my code.

error which is displayed when refreshing

named cell: VerifiName

  

 Error from PQ

Code in Advanced Editor

Item is taking name Order Verification instead of ORDER VERIFICATION

   

  • Hi Simon_29 

     

    Agree with AlexisOlson that M language is case-sensitive, which is the cause. The values in this step should be consistent with the values in Item and Kind columns. 

     

    As it is using Excel.Workbook() to extract the file, the names in Item column with "Sheet" kind are from the Sheet names in the Excel file, not the name of the Excel file. If you want to use your function, you need to keep the sheet name in the Excel file identical with the file name. 

    Best Regards,
    Community Support Team _ Jing
    If this post helps, please Accept it as Solution to help other members find it.

2 Replies

  • M language is case-sensitive, so I suspect that might be the issue here.

     

    Try inputting "Order Verification" rather than "ORDER VERIFICATION".

  • v-jingzhang's avatar
    v-jingzhang
    Community Support

    Hi Simon_29 

     

    Agree with AlexisOlson that M language is case-sensitive, which is the cause. The values in this step should be consistent with the values in Item and Kind columns. 

     

    As it is using Excel.Workbook() to extract the file, the names in Item column with "Sheet" kind are from the Sheet names in the Excel file, not the name of the Excel file. If you want to use your function, you need to keep the sheet name in the Excel file identical with the file name. 

    Best Regards,
    Community Support Team _ Jing
    If this post helps, please Accept it as Solution to help other members find it.