Read and Write excel files on SharePoint


#1

Hello,

I need to read and also write to an excel file on a sharepoint. I tried to use excel application scope to open the excel but failed with the error “The given path’s format is not supported”. The file from sharepoint has the path like “https://sharespace.xxx.com/rooms/project-xxx/Shared Documents/excelfile.xlsx”. the normal document path is like “C:\Users\xxx\Documents\excelfile.xlsx”. I can see it’s quite different format.

Is there any way to interact with excel on sharepoint like we normally do in UiPath?

Thank you very much!

Best regards,
Zoe


#2

Hello @xxdean
You can try to map the sharepoint folder on your local machine so you can read and write, but I believe you’ll need permission


#3

Thanks but I am not so sure what you mean by map sharepoint to local machine? could you explain a bit?


#4

You should map a network drive in your local machine with the sharepoint folder link. But as I said, maybe you need permission.


#5

Hello, I mapped the sharepoint link to local drive Z and run a test below. While the bot is running, I can see it writes to the cells with correct strings. But when the bot finishes running, I checked the excel and the changes (Write cell") are not saved. It seems somehow the Save Workbook activity does not work. Do you have any idea why this happened?

Thank you so much!


#6

Hello @xxdean

You don’t need use the activitie “Save Workbook” , just in activitie Excel application scope set option Auto save.

See image below as example


#7

Hello, I do checked the AutoSave option when I test it. The problem is still there.


#8

@xxdean

Can you share the error you facing?


#9

Hi, I don’t have any error report from UiPath. The problem is that I use Write Cell activity to update cell value in the test code. after the robot finish running (no error occur), when I open the Test.xlsx file, it’s still the same one. no cell value is updated. But during the process, I can see in the excel that UiPath is writing to specific cell (I made the excel activity visible). What makes me so confuse is that why the changes are not saved even if I checked the auto save option?

Sorry I am not allowed to upload my xaml file as a new user, but I did a screenshot below, that is all my code.

Thank you very much again!


#10

Hi @xxdean

Could you try to add a Send Hotkey activity with CTRL+S to try and save the file?


#11

@xxdean

Please check as example the attachement
newTest.xaml (6.6 KB)
newTest.xlsx (8.0 KB)

See if the address file it’s correct.


#12

I just run the example you sent to me with the correct file path in my Z drive (Mapped from Sharepoint link). Still the changes are not saved successfully even if no error occur in UiPath.

When I open the file manually, I see below the protected view. If I need to change the sheet manually, I always need to click Enable Editing. Could this be the problem? if yes, how could I use UiPath to get rid of the protected view? It’s not password protected btw.

Thank you very much!


#13

@xxdean

The Enable editing wasn’t to be a problem, do you have permission to change this mapped folder?


#14

Hello, I think I have the permission. Because if I enable editing, then I can change the document and save it (Manually)