knightwriter
New Member
- Joined
- Jul 4, 2016
- Messages
- 17
Hi all,
I am using the code below to upload a .xlsx file to sharepoint and it seems to only work a handful of times.
My questions is there a difference is one uses \\ or // ? And why does this only work sometimes and not all of the time?
I am using the code below to upload a .xlsx file to sharepoint and it seems to only work a handful of times.
My questions is there a difference is one uses \\ or // ? And why does this only work sometimes and not all of the time?
HTML:
[CODE]Sub uploadtosharepoint()
Dim SharepointAddress As String
Dim LocalAddress As String
Dim objNet As Object
Dim FS As Object
' Where you will enter Sharepoint location path
SharepointAddress = "//teams/BusnsMan/Sales Update" & "\"
' Where you will enter the file path, ex: Excel file
LocalAddress = "F:\Sales\Planning\Sales\Sharepoint extract\Test Sales Report Input.xlsx"
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
End Sub[/CODE]