2016-11-07 78 views
0

我有一个用R编写的自动化Excel报告生成系统,我希望该系统能够在完成后将自动报告上传到分享点。我宁愿将上传步骤写入R.有没有办法做到这一点?通过R将文件上传到分享点

谢谢

回答

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