Hello Everyone,
I working on code which will upload all ShareDrive folder files to SharePoint Document library:
I need this to be done via VBA
I have an excel, at A2, there would be ShareDrive Path and A3 would have SharePoint path
then there would be button, when i click on button all document available under A2 should upload to A3 path.
I found below code but need your help to implement the same.
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 = "\\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
End Sub
need help, please let me know if you need more information.
I working on code which will upload all ShareDrive folder files to SharePoint Document library:
I need this to be done via VBA
I have an excel, at A2, there would be ShareDrive Path and A3 would have SharePoint path
then there would be button, when i click on button all document available under A2 should upload to A3 path.
I found below code but need your help to implement the same.
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 = "\\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
End Sub
need help, please let me know if you need more information.