Hi Guys,
I need to download the excel from the web(from a specific URL) and i need to use that to perform activities(Excel Application Scope). My issue is how to give the dynamic path in excel application scope. i.e how to use the downloaded file
Hope you understand.
Please help me.
Regards,
Sharu
jack.chan
(Jack Chan)
June 11, 2022, 2:06pm
#2
if you dont know the downloaded files name, you can do this
fileName = Directory.GetFiles(FOLDER_PATH,"*.xlsx*").OrderByDescending(Function(d) New FileInfo(d).CreationTime)(0)
where FOLDER_PATH = the download folder
and .xlsx is the extension, (you can change it to your own extension)
now you can use fileName in excelApplication scope
1 Like
Thanks much Jack.
But i am not getting it.
I used this FileName=Directory.GetFiles(Downloads,".xlsx ").OrderByDescending(Function(d) New FileInfo(d).CreationTime)(0)
May i now what variable should be used for Filename?
jack.chan
(Jack Chan)
June 11, 2022, 2:29pm
#4
Downloads needs to be a variable
then set it to be the folder that the file to downlaod to
e.g. if file is downloaded to “C:\Downloads”
then before this
add one more assign statement
Downloads = "C:\Downloads"
1 Like
jack.chan:
“C:\Downloads”
Thanks Jack.
But still i receive the below error.
jack.chan
(Jack Chan)
June 11, 2022, 2:40pm
#6
nono dont put c:\downloads, thats just an exmaple
when you download this file, which folder is it downloaded to?? put that folder path instead of c:\downloads
1 Like
jack.chan:
Downloads
I need to work on the file which is from downloads only
jack.chan
(Jack Chan)
June 11, 2022, 2:45pm
#8
so it will download to the “Downloads” folder right?
1 Like
jack.chan
(Jack Chan)
June 11, 2022, 2:46pm
#10
then assign this to Downloads variable
C:\Users\USERNAME\Downloads
replace USERNAME with your own windows username
Hello @sharu_priya
First of all if you are using Directory.GetFiles(“C:\Downloads”) , it will give you the list of files names. So the out variable should be a string array.
Theyn you need to use a for each loop to loop through each file and that value you need to pass to excel scope. You can refer to the below post to get more clarity.
system
(system)
closed
June 14, 2022, 2:50pm
#12
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.