Hey guys, I'm starting with uipath and I have an Excel numbered from 01 to 31 and I would like the bot to open the tab according to the previous or current day

hey guys,

I’m starting with UiPath and I have an Excel numbered from 01 to 31 and I would like the bot to open the tab according to the previous or current day.

example: today is the 10th, it would look for the tab named “10” and insert information in cell C2

Hello @Gabriela_Menezes, you should create an input argument that uses the current day to open the right tab on excel.

Create an argument that has a dynamic input trough Orchestrator, then use it to write whatever you want or need in the excel file.

Hope it helps, cheers! :slight_smile:

1 Like

@Gabriela_Menezes

Now.ToStirng("dd") - gives todays dat which is 10

Now.Adddays(-1).ToString("dd") - gives yesterdys day which is 09

use the above in sheetname

cheers

2 Likes

Something along these lines:

1 Like

like this?

image

To get the Previous date

Datetime.now.addDays(-1).tostring("dd")

Regards
Gokul

1 Like

For inserting the data in the cell you can try with Write cell activity

1 Like

@Gabriela_Menezes

please give like below

Excel.Sheets(Now.Adddays(-1).ToString("dd")).Range("C2")

two mistakes are assigning date in the same expression and using a reserve keyword date as variable

cheers

1 Like

Just update on you expression @Anil_G

Use this below syntax in the Write cell activity @Gabriela_Menezes

Excel.Sheet(Now.Adddays(-1).ToString("dd")).Cell("A4")
1 Like

It worked, thanks guys

1 Like

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