Vlookup - Col does not exist

Hi, i am working on UI path course "
Excel Automation with the Modern Experience in Studio". There is a Vlookup included. I followed the video instruction, but error keep on showing “VLookup: Column DOCNUMBER does not exist”.

Below is the screenshot.
I downloaded the sample project (the solution) . The only difference I have with the sample project is, I am not able to use the same “reference” for the multiple “use Excel file” activities throughout the project(showing error in the 3rd screen), while the sample can use same “reference” across different “use Excel file” activities.
Consequently, i have to add a number after each reference for a new “use Excel file” activities, even the excel file I am referring to is the same file. I am not sure if this is the problem, because other activities did not have issue (such as copy/paste range, insert Col activities).

Please help. Thank you so much !


image

For this
Make sure the columnname is correct and table we are referring is correct
It could be either ways
Run in debug mode and check in LOCALS panel and see what value is being passed to the variables used in this vlookup activity

And for the error with use excel file
It looks like you have another variable of same name
Better create a new variable or different name and then give a try

Hope this helps

Cheers @Vincent_Shoshin

Hi, I tried both but the same issue is still there. Please help.

Hi,

Can you share your project as zip file?

Regards,

1 Like

just shared, many thanks Yoichi!

HI,

Can you modify it as the following?

  • Turn on HasHeaders option of ForEachExcelRow
  • ByField method is case sensitive. So, try CurrentRow.ByField("DocNumber") in VLookup and
    currentrow.ByField("Profit Per Sale") in WriteCell

img20231024-1

Regards,

1 Like

Hi Yoichi

Thank you so much for your help!!! It is really the “hasheader” option… Have a great week ahead:)

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.