Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

vbasharepoint

ResolvedVersion 2013

Luis has attended:
Excel VBA Introduction course
Excel VBA Intermediate course

Vba/sharepoint

how to automate upload to sharepoint using either access, excel vba or directly from batch file

RE: vba/sharepoint

Hi Luis,

Thank you for the forum question.

I found this code which should help you in the right direction.

sub SharePointUpLoad()
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

Kind regards

Jens Bonde
Microsoft Office Specialist Trainer

Tel: 0207 987 3777
Best STL - https://www.stl-training.co.uk
98%+ recommend us

London's leader with UK wide delivery in Microsoft Office training and management training to global brands, FTSE 100, SME's and the public sector

Tue 22 Sep 2015: Automatically marked as resolved.

Excel tip:

Removing border lines on the keyboard

Highlight your cell(s) that have boreders on them and press CTRL + SHIFT + _, this will then remove the border lines.

View all Excel hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.1 secs.