Hi There.
I have a question for Ui Path Scripting.
I’m trying to make a Bot, to every day extract a base from our CMS application.
There are two fields that need to be filled: “Start” and “End” date.
This date need to be formated like this:
Every first day needs to be the first day in the month.
Every last day needs to be one day before today.
I’ve trying to make a lot of scrips and VB expresions, but i can’t integrate to Ui Path.
Can someone help me ?
Edit***
This is the error that i’m receiving
Main has thrown an exception
Source: Set Text ‘INPUT ctl09_cldDtStart…’
Message: Error HRESULT E_FAIL has been returned from a call to a COM component.
Exception Type: ElementOperationException
UiPath.Core.ElementOperationException: Error HRESULT E_FAIL has been returned from a call to a COM component. —> System.Runtime.InteropServices.COMException: Error HRESULT E_FAIL has been returned from a call to a COM component.
at UiPath.UiNodeClass.Set(String bstrAttr, Object vValue)
at UiPath.Core.UiElement.Set(String attribute, Object value)
— End of inner exception stack trace —
at UiPath.Core.Activities.ScopeActivity.OnFaulted(NativeActivityFaultContext faultContext, Exception propagatedException, ActivityInstance propagatedFrom)
at System.Activities.Runtime.FaultCallbackWrapper.Invoke(NativeActivityFaultContext faultContext, Exception propagatedException, ActivityInstance propagatedFrom)
at System.Activities.Runtime.FaultCallbackWrapper.FaultWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
My Script in VB.NET
If mes = “7” Then
If dia = “1” Then
Dim UltimoDia = DateTime.DaysInMonth(DateTime.Now.Year, 6)
Dim DataInicio = (“01/06/” + DateTime.Now.Year.ToString + " 00:00:00")
Dim DataFim = (UltimoDia + “/06/” + DateTime.Now.Year.ToString + " 23:59:59")
MsgBox(DataInicio.ToString)
Else
Dim PrimeiroDia = DateTime.Now.AddDays(-1).Day.ToString
Dim UltimoDia = DateTime.DaysInMonth(DateTime.Now.Year, 6)
Dim DataInicio = (“01/06/” + DateTime.Now.Year.ToString + " 00:00:00")
Dim DataFim = (PrimeiroDia + “/06/” + DateTime.Now.Year.ToString + " 23:59:59")
MsgBox(DataFim.ToString)
End If
Else
End If