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.
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
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?
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"
But still i receive the below error.
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
I need to work on the file which is from downloads only
so it will download to the “Downloads” folder right?
then assign this to
replace USERNAME with your own windows username
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.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.