Today Date excel file every day updated

Hello everyone.

I would like to ask if it is possible that in a project in which u have an excel file with the today date as name that saves inf for today runs, if it is possible that tomorrow when u do the first run the system checks before if there is any excel that exists with the date of the day that it will executes( so it means that for everyday, before the robot goes and do what he has to do, he checks if there is any excel with the actual date of that day) If yes he goes and continue the job, if not,he deletes the exists excel and creates a new one with the date of that date.

  1. How can I find if there is any excel with the date of the actual date, maybe with Path exists?
    2.How can I tell the robot to go and delete the other excel that exists in case the one that we want does not exists and it will go and create a new one?

For the moment I have only an excel with TodayDate+“xlsx” created for the today date. Any idea if this is possible please?

From what i understand about your requirement

You can have the path Exists activity to check if the file is there
Use the output of that activity for an IF condition

And if you see it is already there you can delete it using the delete activity

I see. In this case how can I tell the program go and delete the file that exists because it is not the one that I need and create this other one that I need with the today date? For example the one that I need to delete contains the yesterday date

Now that I see the delete range does not work outside the excel scope so probably it should be


I was thinking to declare a variable called YesterdayDate and in that one I add the date of yesterday smth like System.DateAdd(“d”,-1,(System.DateTime.Today)) and than I do YesterdayDate+“xlsx” ?

YesterdayDate+“xlsx” ?

yes, but declare yesterdayDate (string variable) as

Now.addDays(-1).toString("ddMMyyyy")

then do fileName = yesterdayDate + ".xlsx"

e.g. if today = 17/7/2022 then yesterdayDate will = "16072022"
so your file will be 16072022.xlsx

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