I’m trying to rename an Excel File and ensure the Filename contains current date. The file’s name is MSFTSep-28-2018.xlsm , so on Sep 29, its name should be MSFTSep-29-2018.xlsm. The File Path is C:\Users\UC218177\Documents\Cross Listing\MSFTSep-28-2018.xlsm. I don’t know how to create a sequence to achieve this purpose.
Dont know if i understood it correctly but you could make a sequence that does:
- go to file path
- left-click the excel file
- click “rename”
- a type-into activity with the .Now syntax
@Yolanda Follow below link
Hi, Ibra. “left-click” can’t rename a file, and “right-click” can’t be executed in Uipath
Thanks a lot. I tried the solution, but it doesn’t work.
Use Like this
strPath=Directory.GetFiles(“C:\Users\UC218177\Documents\Cross Listing”,“MSFT”+DateTime.Now.AddDays(-1).Month.ToString(“MMM”)+“-”+DateTime.Now.AddDays(-1).ToString(“dd”)+“-”+DateTime.Now.AddDays(-1).Year.ToString(“YYYY”))
Then Use Move File Activity
Give Source Path as strPath
and Give Destination File path as
“C:\Users\UC218177\Documents\Cross Listing\MSFT”+DateTime.Now.Month.ToString(“MMM”)+“-”+DateTime.Now.ToString(“dd”)+“-”+DateTime.Now.Year.ToString(“YYYY”)
Regards,
Mahesh