Date conversion from excel value saved as number

Hello,
I am trying to convert the following Date from excel to DateTime but I get this error:
Conversion from string “44053” to type ‘Date’ is not valid.

Date

UIPath Studio sees the date as string:
UIPAthDate

And this is what i have tried:
Condition

Hi,

It’s serial value in excel. Can you try the following?

 DateTime.FromOADate(Double.Parse(cell.ToString))

or

You can get it as string (Not numeric serial value but date string) if you set true PreserveFormat proerty of ReadRange/ReadCell activity.

Regards,

Thank you, FromOADate solved my case, I am looking at the preserve format since not all might get that type.

1 Like