Hi All,
I have a scenario where the excel directory and excel name is dynamic so i how do i pass the value in excel application scope.
Hi All,
I have a scenario where the excel directory and excel name is dynamic so i how do i pass the value in excel application scope.
Whether you are downloading the files and storing it some where?..
No , file will be present before itself
Take a String variable : strExcelPath
assign strExcelPath value as seen in below screnshot
StrFileLocation : Location of excel
Thank you i will try and one more thing is file name ends with year and previous month so how to pass that value . For example its will be
Get the filename from the directory and apply the regex to get month year for the filename .
Use this below regex to get the “201910” from the filename,
“\d{0,}”
To add it use below code of @ImPratham45 or @Palaniyappan
“Monthly Report format_”+Date.Now.AddMonth(-1).Tostring(“yyyyMM”)+“.xlsx”
Hi
Hope these steps would help you resolve this
—in a assign activity mention like
arr_files = Directort.GetFiles(“yourfolderpath”,”Monthly Report format_*.xlsx”)
Where arr_files is a variable of type array of string
—now pass this as input to FOR EACH activity and change the type argument as string in the property panel
—inside the loop use EXCEL APPLICATION SCOPE and mention the input as item.ToString
Or
If we need only the latest file from the folder with the report dated
To get the latest file alone
Str_input = Directory.GetFiles(folder_path,“Monthly Report format_*.xlsx”).OrderByDescending(Function(d) New FileInfo(d).CreationTime).ToList(0).ToString Now pass this as input to Excel application scope
Cheers @rpatil
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.