Hi…
I want to rename excel file downloaded from a browser in a loop…I don’t know the name of the file that will be downloaded and want to rename it to a specific number that I want it to read from an excel file.
Have a look to the below thread :-
Mark as solution and like it if this helps you
Happy Automation
Best Regards
Er Pratik Wavhal
Yes. Why not. While Selecting project we select language from 2 languages i.e., VB.Net or C#.Net so depending on that use the respective syntax.
Happy Automation
Best Regards
Er Pratik Wavhal
@Pratik_Wavhal I dont want any date or anything…instead I want to rename it according to the other excel file
Hi @Kajal_Sharma,
I am also curious to know how you are downloading that file is this automatically downloads? or
it will ask for any prompt to save?
Regards,
Aditya
I thought depending on latest downloaded file of which you dont know the name you have to rename it so gave you above link.
My mistake i didn’t get the que properly
Then if you have to just rename then have a look to the below thread for the same :-
Mark as solution and like it if this helps you
Happy Automation
Best Regards
Er Pratik Wavhal
Hey @Kajal_Sharma,
Here you go use these commands to get the last modified file from directory.
String.Join(“”,Directory.GetFiles(our_FolderPath,”*”,SearchOption.AllDirectories).OrderByDescending(Function(d) New FileInfo(d).CreationTime).Take(1) )
Note:
1.Replace our_FolderPath with your desired folder path
2.Replace “” with your required file format “.xlxs”,”*.pdf”
Then you can use rename method to change the name using invoke method.
Mark this as solution if this helps.
Happy Automation!
Regards,
Aditya