【问题标题】:Uploading file to sharepoint through R通过 R 将文件上传到共享点
【发布时间】:2017-03-20 15:42:15
【问题描述】:

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

谢谢

【问题讨论】:

    标签: r excel sharepoint automation


    【解决方案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
    

    【讨论】:

      【解决方案2】:

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

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

      另请参阅Saving a file to Sharepoint with R 以了解更多信息

      【讨论】:

        猜你喜欢
        • 2014-06-12
        • 1970-01-01
        • 1970-01-01
        • 2022-06-29
        • 2019-11-14
        • 2012-04-15
        • 1970-01-01
        • 1970-01-01
        • 2020-10-16
        相关资源
        最近更新 更多