【发布时间】:2016-07-15 09:29:41
【问题描述】:
当我使用下面的代码时,没有文件被复制到共享点,但代码没有显示错误。有人可以帮我吗?
Dim SharepointAddress As String
Dim LocalAddress As String
Dim objNet As Object
Dim FS As Object
SharepointAddress= "\\xxxx\sites\xxx\xxx"
' Where you will enter your location path
LocalAddress = "yourfile path\test.xlsx"
' Where you will enter the file path, e.g.: Excel file
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
【问题讨论】:
-
有人可以建议一些替代方法或帮助我解决这个问题
-
如果这没有抛出错误,你确定你使用的是正确的路径吗?
-
是的benno..文件路径是对的..我需要在给出本地地址路径的同时指定文件名吗?
标签: vba sharepoint upload