Uploading new file to Sharepoint and updating existing file

Use case: I want to update an Excel-file on Sharepoint and also upload a new file to Sharepoint. The files in question are not used for collaboration.

Observation: The authentication procedure at my organisation is not supported by the “Microsoft 365” package by UiPath. Using UiPath.Excel.Activities, it is possible to read files on Sharepoint by entering a document’s share URL in the “Excel file” field of the “Use Excel File”-activity. However, writing fails (“read-only”) despite it not being in use and despite using click-activities to “Enable Editing” during runtime.

Request: If possible, how can I overcome these obstacles reliably using official packages?

Solution:

  • To update existing file on Sharepoint, use the corresponding WebDAV server path (see below) to temporarily copy the file from Sharepoint to your local storage, make the necessary edits, and then move it back to SharePoint using WebDAV. (step 1-3 below)

  • To upload new file, move the file by providing the desired WebDAV server path. (step 3 below)

    Server path example: \\xx.xx.xx@SSL\DavWWWRoot\sites\xx\xx\xx\FileName.xlsx

    To generate the server path, paste the SharePoint document’s share URL (excluding the file name) into the address bar when selecting the ‘From:’ location in the ‘Copy File’ activity. This will open the Sharepoint directory where you can click on a desired file. After confirming with ‘Open,’ the WebDAV server path will be displayed in the ‘From:’ field.

  • Note: Your robot needs to be running on a computer or VM signed in to an account with access to the desired Sharepoint site.




Steps:

1. Copy File
From: <server path>
To: C:\Temp\Blank.xlsx
Overwrite: True

2. Excel Process Scope

Use Excel File

File Path: C:\Temp\Blank.xlsx
Save changes: True

<editing activities>

3. Move File
From: C:\Temp\Blank.xlsx
To: <server path>
Overwrite: True

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.