VLookup Activity Error: DoubleConverter cannot convert from (null)

Hi everyone,
I’m working on an Excel automation project using Modern Excel activities in UiPath Studio. I’m trying to use the VLookup activity to retrieve a value based on the “Document Number” from another sheet. However, I’m getting the following error:
–DoubleConverter cannot convert from (null)–

  • I’m looping through rows using For Each Excel Row.
  • Inside the loop, I’m using VLookup.
  • In the “Value to lookup” field, I’m passing:
  • CurrentRow.ByField(“Document Number”)`
  • The lookup range and column index are correctly set.
  • But the error appears when the VLookup executes.

Any suggestions would be appreciated.
Thanks!

@Omar_Rida,

Follow this tutorial.

Hi @Omar_Rida
Welcome to UiPath,

This error means the value you’re trying to look up is empty. before using vlookup, add an if condition to check like below:

Not string.isnullorempty(currentrow.byfield(“document number”).tostring)

this will skip rows where the document number is missing and prevent the error.

If you found helpful please mark as a solution. Thanks
Happy Automation with UiPath

I have been having this problem for a day and i cant find the problem. The value is not empty!!

@Omar_Rida

A better way would be to use write cell and write the vlookup formula in first cell and then use auto fill ramge activity then you can read it

Or read the data and then use filter datatable or lookup on it

Check on which row it is failing..is the output of vlookup type given as number? If so that is causing the issue

Cheers

@Omar_Rida
Before running VLookup, use an Assign activity:

YourdataTable = dataTable.AsEnumerable().Where(Function(row) Not String.IsNullOrEmpty(row(“YourLookupColumn”).ToString)).CopyToDataTable()