Avatar of shieldsco
shieldsco
Flag for United States of America asked on

Access VB Download Files SharePoint 2013

I'm trying to download a file from SP 2013 using a button on an Access form. Can example code be provided. Thanks
Microsoft SharePointMicrosoft AccessMicrosoft ApplicationsMicrosoft OfficeVBA

Avatar of undefined
Last Comment
Anastasia D. Gavanas

8/22/2022 - Mon
Scott McDaniel (EE MVE )

Do you have code that you've tried, but it didn't work? If so then post that and let us know what did not work, and we'll try to help. We're not really here to do your work for you, but rather to help you when you get stuck.
shieldsco

ASKER
I got the code to work below but I would like to use a wild card (*) for any Excel file in the SP Folder. There will always only be one Excel file in the SP Folder.

On Error GoTo errHere
 
Dim strQRY As String
 
Dim strHTTP As String
Dim strFileToSave As String
 
strHTTP = "https://asfr.hhh.net/OF/OFSPO/hhsfmg/mwwg/Data%20Call%20%20DDA/2016%20September%20DDA%20Data%20Call.xlsx"
strFileToSave = "C:\Users\shieldsco\Documents\Vince.xlsx"
 
If fnDownloadHTTP(strHTTP, strFileToSave) = False Then      ' -- downlaod the file
    MsgBox "File DL failed. Make sure folder exist"
    GoTo ExitHere
End If
 
MsgBox "All files downloaded"
 
ExitHere:
    Exit Sub
errHere:
    MsgBox "Error"
    Resume ExitHere

Open in new window

shieldsco

ASKER
I would like to download any file that has the xlxs extension in the SP folder
Your help has saved me hundreds of hours of internet surfing.
fblack61
SOLUTION
Anastasia D. Gavanas

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
ASKER CERTIFIED SOLUTION
Helen Feddema

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
shieldsco

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
shieldsco

ASKER
Thanks
shieldsco

ASKER
I got the code to work below but I would like to use a wild card (*) for any Excel file in the SP Folder. There will always only be one Excel file in the SP Folder.
Anastasia D. Gavanas

good comments made and solutions proposed
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.