As follows i see below error when trying to convert date from string. Strange thing is same code works correctly on the other server which has the same Regions configured. Moreover if i run this code from console application it works. This error only happen when scheduled in windows service. Why it happens, is there better way to do it?
Try
Dim fileDateStr = Data(0, 0).ToString()
fileDateStr = fileDateStr.Substring(0, fileDateStr.IndexOf("(", StringComparison.Ordinal))
Dim dateValue As Date
If Date.TryParse(CDate(fileDateStr), dateValue) Then
ReportDate = CDate(fileDateStr)
End If
Catch ex As Exception
..

TryParse: you're trying to parse aDateinto aDate, and because you useCDateunconditionally, you get the exception thatTryParseis designed to avoid. You should either eliminate theTryParseand let theTry/Catchhandle the errors, or eliminate theCDatecalls and address any date errors in theFalsebranch from theTryParsecall.