通过R编程访问SharePoint XLSX

发布于 2025-01-20 03:28:00 字数 1038 浏览 2 评论 0原文

我目前正在尝试访问公司共享点驱动器中存在的 xlsx 文件,

URL - https://xxxx.sharepoint.com/:x:/r/sites/cqa/xxxx/_layouts/15/doc2.aspx?sourcedoc=%7BFxxx390-B71D-4C71-B252-6E3DCA8E9FDA%7D&file=Updated%20LXXal%20Reqxxxxents%20for%20XXXXX%20XXXX%20Actixxxx.xlsx&action=default&mobileredirect=true&cid=0abe8bcd-c785-4c14-a9f3-263e8e806aa6

我阅读了多个链接,但它们似乎都不起作用。 尝试使用 httr::GET

require(httr)
url <- "above url"
r <- GET(url, authenticate("[email protected]","password"))

但收到以下错误响应:

  Date: 2022-04-08 13:07
  Status: 403
  Content-Type: text/plain; charset=utf-8
  Size: 13 B

尝试使用 Microsoft365R::get_sharepoint_site("above url") 但显示“需要管理员批准”。

是否有任何其他直接方法可以通过 R 在数据框中读取文件。任何建议都会有所帮助。

I am currently trying to access a xlsx file present in company sharepoint drive

URL - https://xxxx.sharepoint.com/:x:/r/sites/cqa/xxxx/_layouts/15/doc2.aspx?sourcedoc=%7BFxxx390-B71D-4C71-B252-6E3DCA8E9FDA%7D&file=Updated%20LXXal%20Reqxxxxents%20for%20XXXXX%20XXXX%20Actixxxx.xlsx&action=default&mobileredirect=true&cid=0abe8bcd-c785-4c14-a9f3-263e8e806aa6

I read multiple links but none of them seem to work.
Tried using httr::GET

require(httr)
url <- "above url"
r <- GET(url, authenticate("[email protected]","password"))

But getting the below error response:

  Date: 2022-04-08 13:07
  Status: 403
  Content-Type: text/plain; charset=utf-8
  Size: 13 B

Tried using Microsoft365R::get_sharepoint_site("above url") but it shows "Need admin approval".

Is there any other direct way to read the file through R in a dataframe. Any suggestion would help.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

江南月 2025-01-27 03:28:00

我已经能够使用以下代码访问共享点中的 xlsx 文件:

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")

I have been able to access a xlsx file in a sharepoint with the following code :

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")
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文