When I use the below code, no file is copied into the sharepoint, but the code does not show an error. Can someone help me here ?
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