gorby
(RPA Ninja)
November 5, 2026, 4:18am
1
Hello.
I’m a UiPath StudioX Enterprise Licence 2024.10.14 LTS user.
I know Excel’s WORKDAY function calculates a date N business days later, excluding weekends and public holidays. Could you please let me know how to achieve the same result using VB.NET syntax or a UiPath activity? There’s no need to account for special holidays such as the year-end and New Year holidays or the company anniversary.
@gorby
You can try this approach.
Prepare holiday date list for the year as the default vb code won’t have it. You can prepare an Excel or CSV file.
Read it using read range into a datatable.
Use Assign activity or use Set Variable Value in StudioX to convert datatable Date column dates into a list. This is to make the calculations easy.
lstHolidays = dtHolidays.AsEnumerable().Select(Function(r) CDate(r("Date")).Date).ToList()
Now use another Set Variable Value activity and calculate n th day in a DateTime variable.
startDate - Datetime variable
nDays - Int32 variable
nthDay = Enumerable.Range(1, 3650) _
.Select(Function(i) startDate.Date.AddDays(i)) _
.Where(Function(d) d.DayOfWeek <> DayOfWeek.Saturday AndAlso d.DayOfWeek <> DayOfWeek.Sunday AndAlso Not lstHolidays.Contains(d)) _
.ElementAt(nDays - 1)
Sample code -
Holiday Excel:
Output:
gorby
(RPA Ninja)
November 7, 2026, 12:17am
3
Hi @ashokkarale
Thank you for your detailed answer.
However, I realized that using Excel’s WORKDAY function from UiPath is much simpler.
Thank you for your time!
Hi,
You can use Non Working Day on orchestrator: Tenant->Setting->Non-Working Days
And use the trigger settings → Non-working days restrictions
gorby
(RPA Ninja)
November 9, 2026, 3:18pm
5
Hi @Hulya_CIVAK2 ,
I don’t use Orchestrator or Tenants at all!