I am trying to read date using readcell (this is the requirement so, didn’t used read range).
is has two dates 01/09/2019 and 15/09/2019. It is reading 01/09/2019 fine. But, it is throwing exception on 15/09/2019.
RemoteException wrapping System.FormatException: 15/09/2019 is not a valid value for DateTime. —> RemoteException wrapping System.FormatException: String was not recognized as a valid DateTime.
at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles)
at System.ComponentModel.DateTimeConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value)
— End of inner exception stack trace —
at System.ComponentModel.DateTimeConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value)
at UiPath.Excel.Activities.ExcelReadCell.SetResult(AsyncCodeActivityContext context, Object result)
at UiPath.Excel.Activities.ExcelInteropActivity`1.EndExecute(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.System.Activities.IAsyncCodeActivity.FinishExecution(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
Please let me know how can I read this only using dd/mm/yyyy as I cant change input excel file.
This exception is happening on the Read Cell activity or is it happening in some Assign activity?
The dates are separate right? In one cell you have 01/09/2019, and in the second 01/09/2019, or do you have both value in one cell?
It is happening in read cell which is under excel application scope. Also, ye the dates are in different cells. Its just that the date in excel is mention in dd/mm/yyyy format and uipath is reading it in mm/dd/yyyy format( as 15 is not a month in calendar that’s why throwing error)
the date which uipath is throwing error is 15/09/2019. which is in dd/mm/yyyy format
As you said you can’t change excel then i would advice to use Read Range Activity to Read entire data and take your cell by using datatable row index and column and then you can convert your datetime string to either datetime datatype or Different Datetime string format as per your needs.
This is my file, I was using read cell as I need to read vertical table(which I don’t know how to do, that’s why using read cell as I was required to get liitle info). let me know, How I can read this horizontal table, extracting the place, the two dates in separate variables.
What is output variable type of the read cell activity. If it is DateTime type, then try change it to string and read. Later if needed you can convert it into date format as required.