String was not recognised as valid timespan error

I am trying to read a value from excel and assign it to the delay activity. I assign the excel value e.g 00:00:15 to a string variable with:

varDelayStr = row.item(0).ToString

Then I assign the above to a TimeSpan variable with:

varDelay = TimeSpan.Parse(varDelayStr)

When I run my process I get an error stating String was not recognised as valid timespan

Please could someone give me a pointer to where I am going wrong.

Thanks for any help

Hi @kjhsdhkfskh
it seems to be working fine for me
Main.xaml (9.5 KB)

I think make the following changes to ur code

varDelayStr = row.item(0).ToString.Trim

varDelay = TimeSpan.Parse(varDelayStr)

Nived N


Thank you for taking the time to reply. This seemed to do the trick. I did get another error which I resolved by changing the format of my time to in the spreadsheet.

Kind regards

1 Like

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