Open Excel workbook from URL

Hi folks :slight_smile:

I have a workflow that needs to retrieve data from a number of excel files, all stored in a Sharepoint site.

In my little test workflows, and when the .xlsx files are stored on my local computer (ā€œc:\yadayada"), everything works fine, but when I try to open an Excel application scope with a URL instead (https:\sharepoint\yadayada\myFile.xlsxā€), I get an exception: "The given pathā€™s format is not supportedā€.

Any ideas?

Thanks,
Jeppe

I too require to work with Excel on Sharepoint and faced with the same problem as you do. ā€œThe given pathā€™s format is not supportedā€.

For now, iā€™m thinking with using basic click activity to get sharepoint auto launch excel then attached the Excel scope to it. I will try it out tomorrow and update your thread if I find any solution.

Would appreciate if anyone have ideas to open Excel in Sharepoint in a more efficient manner. Also to share that downloading the excel document to local drive and uploading back to sharepoint is not an option for me.

HI jjes,

My idea to workaround fail, and after googgling around, there is any feature that UiPath is able to support excel URL. Guess iā€™m forced to download a local copy, make the changes and upload it back to sharepoint :frowning:

Perhaps, UiPath could look into supporting URL in the Application Excel Scope.

I found it to be a security issue in our network. If I connected to a document in the ā€œoutside worldā€, still from our network, it would still fail. I then tried to access the ā€œoutside worldā€ file from a different, non-corporate network, and it worked out fine.

I found that documents - even those on our corporate network - would open just fine in a webbrowser, and I thought of something I did years ago in another solution: pretending to be a browser.

Using a network traffic sniffing tool, Fiddler, I found out exactly how a http-request from a browser looked, especially the values in the http headers. I copied the values from the http header, and in UIPath I added those values to the Headers property in the HTTPRequest activity in UIPath.

With a little bit of work, the request sent by the HTTPRequest activity in UIPath looked enough like a webbrowser request, that our secutity policy let the traffic through, and I could retrieve the .xlsx with no problems.

I have since explained to our security team what I am trying to do, and they have since agreed to loosen the security for this specific type of traffic, of course still limited by IP address etc.

Hope it makes sense, otherwise ask :slight_smile:

hi @jjes ,

instead of using the HTTP path e.g. https://sharepoint/yadayada/myFile.xlsx

try using the local windows explorer path format by reversing all ā€˜/ā€™ and removing ā€˜https://ā€™

try this one: \\sharepoint\yadayada\myFile.xlsx

:grinning::grin:

2 Likes

For those who are still having issues with this, hereā€™s an alternative approach in case you are not having fun playing with the url :slight_smile:

Instead of typing in the entire url in the WorkbookPath box inside the ExcelApplicationScope activity, click on [ā€¦] and browse to the sharepoint directory itself. Once the browse window loads, plug in the url without the filename/extension (https:\sharepoint\yadayada) in the address box and hit enter. This will take you to the file directory where you will see all your files that exist in the container (see attached example).

So now you can easily double-click your target file, and the filepath will automatically generate in the WorkbookPath box inside the ExcelApplicationScope activity. It will look something like this: "\sharepoint\DavWWWRoot\yadayada\myFile.xlsx"JJES

1 Like

Hi,

I am trying to open a Sharepoint in browser using a hyperlink in email. The link opens the correct file but asks user to download the file locally. Is there any way I can open that file in browser?
More details in How to construct a Sharepoint filepath with sourcedoc param?

Rather then trying to open in the browser window, I would recommend that you download it and open it in an Excel Application Scope, much easier to work with. The UiPathTeam created a UiPathTeam.SharePoint.Activities (I tested with version 1.5.2) from the UiPath Marketplace. With it you can then easily perform it as:

Additional activities for document libraries include, these related activities that you might also need (and others):
Check In File
Check Out File
Get File
Upload File

Since your example was using Teams, set the SharePoint application scope to use -WebLogin or your username/pwd. Also in the URL to the SharePoint site, do not include the user interface references of /: x :/r/ which implements display/formatting.

1 Like

Hi GenxDo,

I am looking for a way to download file from sharepoint to local project folder used by UiPath. but i selected the ā€˜Get Fileā€™ as your screen, and input the item url as ā€œDocuments/OP.xlsxā€, and download OP.xlsx to local path. i also ensure the OP.xlsx resided in sharepoint.

run the sequence, the error in output is 'Get file: File Not Found".

Would you pls share more detail about your sample? is the file exsting in Documents on sharepoint?

Thanks.

Hi @chenjj111,

This is not an official UiPath Activity the naming of the package looks so but its not official. It is great for development use cases, but I would stray away from using it in production robots.

  1. The documentation of this library is poor
  2. It is slow when compared to alternatives

We first thought of using the library you are using as well, but after trying it out we realized itā€™s best to do it ourselves using a Powershell script that way we could design the function ourselves and if something did not work, we have access to the source code.

A better way is to use PowerShell to download the file from the URL to your desired destination path using either Invoke Power Shell or Start Process activites. Then do the necessary logic in UiPath (Exists Path ā€”> Open Workbook ā†’ Other Logic).

Hello , it seems it works well when i am using the ā€˜Get Fileā€™. in this activity, 1.Relative URL:
ā€œShared Documents/OP.xlsxā€ (itā€™s a site URL base on the sharepoint folder url you defined in the Sharepoint application scopeā€™. 2. LocalPath, define as you needed.
the key point solved already.

With the suggested approach I am getting below errors, not very frequently but some times

Error Message: A device attached to the system is not functioning
Source: mscorlib
OR

Access Denied. Before opening files in this location, you must first add the web site to your trusted sites list, browse to the web site, and select the option to login automatically.

I am just thinking if the above issues could be due to WebClient service getting stopped (reason still mystery, nothing on windows logs as well )

(Note : I am not allowed to use non official packages)