Regarding workflow

hi ,
i have to create a new excel workbook for each day and for current day it should only needs to overwrite the content and for for next date it should create new excel with the date as name of excel sheet

@jeevi_jeeva,

Give the filename in this format

DateTime.Now.ToString("ddMMYYYY") + ".xlsx"

Hi @jeevi_jeeva,

To get the current date you can use DateAndTime.Now, while for the next day your can use DateAndTime.Now.AddDays(1). Perhaps you should use one of these within your if condition.

For writing your excel files, you can use https://docs.uipath.com/activities/docs/read-write-and-append-data-in-excel

Best regards,
Marius

@jeevi_jeeva

  1. Use assign activity to get all the file from a folder :
    File = Directory.GetFiles(path)

  2. Use assign activity to get the current date and time :
    CurrentDateTime = System.DateTime.Now

  3. Use for each activity to get all the files one by one

  4. Inside for each activity use assign activity to replace the file path and extension :
    FileName = file.ToString.Replace(path,“”).Replace(“.xlsx”,“”)

  5. Use if condition activity : FileName.Contains(CurrentDateTime)

  6. If the file name contains today date, will perform further activities :

image

  1. If the file doesn’t contain today date: Use assign activity to count the files
    FileCount = FileCount + 1

  2. Outside the for each activity, use if condition activity :
    FileCount.Equals(ExcelFiles.Length)

  3. If the condition satisfied then use the Create File activity to create a worksheet :
    filelocation = path (You can create it anywhere you want )
    filename = “Database_”+CurrentDateTime+“.xlsx” (Database_ is just string )

Hope this will you

Happy automation

Best Regards,
Vrushali