Hi @prasath17
may be if he hadn’t tick the preserve format range , then date would come in format as MM/dd/yyyy HH:mm:ss when used .ToString
when debugging the workflow , there is exception details section which u can check for detailed exception
Hi @prasath17
may be if he hadn’t tick the preserve format range , then date would come in format as MM/dd/yyyy HH:mm:ss when used .ToString
when debugging the workflow , there is exception details section which u can check for detailed exception
seems that this may be an issue with invoke code
can u try @prasath17 code with below changes
dt.AsEnumerable().ToList().ForEach(Sub(row) row(1)=DateTime.ParseExact(row(1).ToString.Trim,“dd/MM/yyyy”,System.Globalization.CultureInfo.InvariantCulture).ToString(“dd/MM/yy”))
assuming that column index of Date d’entrée is 1
also tick the preserve format option in read range
19.10.6+Branch.support-v2019.10.Sha.9162a1e5a24a523df288d8d981c0096cc394d01d
Source: Invoke code
Message: Exception has been thrown by the target of an invocation.
Exception Type: System.Reflection.TargetInvocationException
RemoteException wrapping System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. —> RemoteException wrapping System.FormatException: String was not recognized as a valid DateTime.
at System.DateTimeParse.ParseExact(String s, String format, DateTimeFormatInfo dtfi, DateTimeStyles style)
at UiPathCodeRunner_9bcb912876ca4275880f61d24c37dc1a._Lambda$__1(DataRow row)
at System.Collections.Generic.List1.ForEach(Action
1 action)
at UiPathCodeRunner_9bcb912876ca4275880f61d24c37dc1a.Run(DataTable& dt)
— End of inner exception stack trace —
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object parameters, Object arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object parameters, CultureInfo culture)
at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object providedArgs, ParameterModifier modifiers, CultureInfo culture, String namedParams)
at UiPath.Activities.System.Utilities.InvokeCode.CompilerRunner.Run(Object args)
at UiPath.Activities.System.Utilities.InvokeCode.NetCodeInvoker.Run(String userCode, List1 inArgs, IEnumerable
1 imps, Object args)
at UiPath.Core.Activities.InvokeCode.Execute(CodeActivityContext context)
at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.ActivityInstance.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)
@Soudios - As I asked, please share the screenshot of the sheet(at least showing 10-20 rows) I would like to look at the date formats…
Same problem :
@Soudios - I see your format is M/d/yyyy..but in your query you asked for dd/MM/yyyy
Not sure, why the requirement has changed???
it is different for me to it is in dd-MM-yyyy
I don’t see that
@Soudios - You changed your sheet…I downloaded when you attached initially…that is what i saw…
Yes i just added something in column C
i got the correct requirement
Please check the input file with my workflow
Not working, i think because i am using an old excel
It seems that i am also using same excel version too
No i am using excel 2010, to send you the draft i sent u from a other excel version