Anantha Krishna
Member
Hello All,
Kindly support me for the below situation.
i need to upload Excel file to Sharepoint, for this i am using below code, but it is not working, it is stoping at "FS.CopyFile LocalAddress, SharepointAddress"
**** Use code - tags ****
Thanks is Advance
Anantha
Kindly support me for the below situation.
i need to upload Excel file to Sharepoint, for this i am using below code, but it is not working, it is stoping at "FS.CopyFile LocalAddress, SharepointAddress"
**** Use code - tags ****
Code:
Dim NewfilePath As String
Dim LastRow As Long
Dim SharepointAddress As String
Dim LocalAddress As String
Dim objNet As Object
Dim FS As Object
SharepointAddress = "https://sharepoint.com/sites/Shared Documents/Forms/AllItems.aspx"
LocalAddress = (ThisWorkbook.Path & "\"ExcelFile.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
Thanks is Advance
Anantha
Last edited by a moderator: