I am trying to create a bot that will download an .xls file with a dynamic ID from the internet and then open that file in Excel, but am getting the error I mentioned in the title. I am using an input dialog to input the file pathway where my download is sent (C:\Users\willl\Desktop\RPA\BotAThon), assigning this input to the “DownloadLocation” variable. From there, I am trying to assign a variable to my most recently downloaded file in the folder with the following:
“RecentFile” = String.Join(“”, Directory.GetFiles(DownloadLocation,”*xls”,SearchOption.AllDirectories).OrderByDescending(Function(d) New FileInfo(d).CreationTime).Take(1) )
When specifying the file pathway in the Excel application scope, I am entering “DownloadLocation + RecentFile” and getting this error. What am I doing wrong?
I am new to UiPath, so I apologize if this is a stupid question.
I used RecentFile in the ExcelApplicationScope and got another error, it also tried creating a new spreadsheet rather than working in the one I wanted to open. It won’t let me attach my file, so here are some screenshots:
Can you share the exception message?
I guess it might be locked by another process (eg. browser etc). So can you try to copy the file to another place, then open it with excel application scope?
(Or close the application which is locking the file)