Excel Application Scope Error: The given path's format is not supported

Hello everyone,

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.

Hi,

As RecentFile has not only filename but also its path, can you try to use just RecentFile in ExcelApplicationScope?

If possible, can you share your workflow as file or screenshot?

Regards,

Directory.GetFiles includes the full path and filename, so by adding the path again you’re giving it something like “C:\temp\c:\temp\myfile.txt”

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:

Any help is appreciated

Hi,

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)

Regards,

This is for a school assignment, so I changed my process a little. Could you please look at my most recent post? I ran into another issue