2

I am trying to access an Excel file from my company's Sharepoint site. I've looked into all the answers on Stack Overflow regarding R and Sharepoint and came up empty handed.

This currently works for me:

r <- GET("http://company.SharepointSite.com/Test.xlsx", authenticate("user", "pswd", "ntlm")) 

However, I have no idea how to get this into a data frame. Moreover, I really would like this to work for files with the .xlsb extension.

Now, when I tried this:

sharepoint_data <- read.table(
  text = getURL(
    csv_url,
    userpwd = paste0(username, ":", password)
  ),
  header = TRUE, 
  sep = "," 
) 

I get a X401 Unauthorized error

Any help would be much appreciated.

figNewton
  • 127
  • 1
  • 12

1 Answers1

0

Got it! .xlsb did not work but .xlsx and .csv work fine. Moreover, I needed the "?Web=0" extension at the end of my url for the sharepoint.

figNewton
  • 127
  • 1
  • 12