Read Month and Select Start & End Date in Calender

Hi Guys,

Please kindly advice
I have an excel file containing only Month information and I want to select Start and End date of that Month in the web interface

Here I attach the screenshot of the UI


Thank you guys

Hi @Russpe01,

If you need start date of a month, then the below line will help

New DateTime(Now.Year, Now.Month, 1)

Hold its output to a datetime variable named startDate,and the following line will help you to get the last date of the month


You need to pass Year, Month as integer so that you will get the desired value.

Hi @sarathi125,

Thanks for your reply,

since I am new in UI path, where should I put that formula?

Here an error msg I’ve got when put it in type into


Check the variable tab in UiPath Studio, your startDate is in GenericType. You need to convert that to System.DateTime datatype.

And inside the Type Into Input, you need to pass “startDate.AddMonths(1).AddDays(-1).ToString()”

Hi @sarathi125

The Month format in Excel file is MMM, is this formula applicable for that? and there is no Year information, but we can hard code it as 2019

Here I attach my .xaml which still have an error
Main_Question.xaml (15.4 KB)


Checked your xaml and corrected/modified two things. To get month name from excel row and type into start date.

Main_Question.xaml (15.5 KB)

Hi @sarathi125

Thanks for the reply, but I have found another way to link it :slight_smile:

1 Like


Share your solution here, so that it may help someone.

Hi @sarathi125

I simply create another excel file with Month, start date and end end column there and use For Each Row to check both file containing Month. For selection in the web interface, I send hot key to blank the field and use Type text according to start and end date I’ve got from For Each command

Thank you

1 Like

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