通过R将文件上传到sharepoint

时间:2016-11-07 10:20:40

标签: r excel sharepoint automation

我有一个用R编写的自动excel报告生成系统,我希望该系统在完成后将自动报告上传到sharepoint。我更愿意用R写的上传步骤。有没有办法做到这一点?

由于

2 个答案:

答案 0 :(得分:1)

我从未听说过使用R将文件加载到SharePoint中。如果您已经在使用Excel,只需运行一个小型VBA脚本即可将文件加载到SharePoint中。

Dim SharepointAddress As String
Dim LocalAddress As String
Dim objNet As Object
Dim FS As Object

' Where you will enter Sharepoint location path
SharepointAddress = "\\sharepoint path to document library"  & "\" 
 ' Where you will enter the file path, ex: Excel file
LocalAddress = "your file path"                                     
Set objNet = CreateObject("WScript.Network")
Set FS = CreateObject("Scripting.FileSystemObject")
If FS.FileExists(LocalAddress) Then
FS.CopyFile LocalAddress, SharepointAddress
End If
Set objNet = Nothing
Set FS = Nothing

答案 1 :(得分:0)

尝试使用修改后的文件路径,如下所示:

write.csv(data, "\\\\mysite.myorg.com@SSL/personal/myusername/Documents/Shared with Everyone/submission.csv")

也请参阅Saving a file to Sharepoint with R以获取更多清晰信息