5

I am attempting to pull data from our SharePoint using the instructions found here (StackOverflow question). Here is the code I am using:

library(readxl)
read_excel('//MyCompany.sharepoint.com/teams/MyProject/Shared Documents/MyExcelFile.xlsx',
       'Sheet1',
       skip=1)

When I enter https://MyCompany.sharepoint.com/teams/MyProject/Shared Documents/MyExcelFile.xlsx into my browser it prompts me to open the Excel document in Excel (not Excel online). So my assumption is that the link works. I have also tried using the httr package as such (with no luck):

data <- GET(url, authenticate("username","password",type="any"))

Any help is much appreciated.

Phil
  • 7,287
  • 3
  • 36
  • 66
Leif
  • 125
  • 9

1 Answers1

0

I have been able to download some Excel files from some SharePoints. Afterwards, I was able to read the content of the Excel file afterwards. Here is an example of the code I use :

library(readxl)
url <- "https://sharepoint.mycompany.ca/teams/report/file.xlsx"
download.file(url = url, destfile = "D:/file.xlsx",
              mode = "wb")

read_excel("D:/file.xlsx")
Emmanuel Hamel
  • 1,769
  • 7
  • 19