Go Back   Access World Forums > Microsoft Access Discussion > Modules & VBA

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 10-12-2019, 03:17 AM   #1
Pat_M
Newly Registered User
 
Join Date: Oct 2019
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
Pat_M is on a distinguished road
Create Sharepoint Online folder from VBA (access 2016)

I am a newcomer to SharePoint Online and I am trying to add a subfolder to a SharePoint Document Library from Access 2016 using VBA.

As this is my first post here I cannot add links to a recent post in Stack overflow "Create Sharepoint folder from VBA (access 2016)" which seems to be exactly what I need but...

Could anyone give a fuller example of the code needed to achieve this?
What API do I need to reference and how.
What references do I need in the access database: Microsoft Scripting Runtime, Microsoft XML, V6.0, VBA-JSON v2.3.1 module?
Also what url I would need to specify if the top level documents are located in this type of path:
h ttps://SampleName.sharepoint.com/sites/sitename/Shared Documents/

Thank you.

Pat_M is offline   Reply With Quote
Old 10-12-2019, 03:45 AM   #2
isladogs
Part time moderator
 
isladogs's Avatar
 
Join Date: Jan 2017
Location: Somerset, UK
Posts: 10,862
Thanks: 114
Thanked 2,967 Times in 2,701 Posts
isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold
Re: Create Sharepoint Online folder from VBA (access 2016)

Hi Pat.
Welcome to the forum
Have you tried asking at SO as well?
If you copy the SO link here, one of the mods can edit your post and make it an active link
__________________
If this answer has helped, please click the Thanks button and/or click the 'reputation scales' symbol on the left.

Website links:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Colin (Mendip Data Systems)
Access 2010 32-bit, Access 2016 32-bit & 64-bit, SQL Server Express 2014, Windows 10,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
isladogs is offline   Reply With Quote
The Following User Says Thank You to isladogs For This Useful Post:
Pat_M (10-12-2019)
Old 10-12-2019, 03:50 AM   #3
Pat_M
Newly Registered User
 
Join Date: Oct 2019
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
Pat_M is on a distinguished road
Re: Create Sharepoint Online folder from VBA (access 2016)

Thanks isladogs, here's the link:

https://stackoverflow.com/questions/...ba-access-2016


Last edited by isladogs; 10-12-2019 at 03:55 AM. Reason: Added active link
Pat_M is offline   Reply With Quote
Old 10-12-2019, 04:01 AM   #4
isladogs
Part time moderator
 
isladogs's Avatar
 
Join Date: Jan 2017
Location: Somerset, UK
Posts: 10,862
Thanks: 114
Thanked 2,967 Times in 2,701 Posts
isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold
Re: Create Sharepoint Online folder from VBA (access 2016)

Thanks.
I can't help you with SharePoint as I've never used it.
However others will I'm sure be able to advise.

As for which APIs and references you may need, that will depend on what you're trying to do. For example, are you intending to work with XML or JSON files?

The more precisely you can explain your requirements, the more focused the responses will be.
__________________
If this answer has helped, please click the Thanks button and/or click the 'reputation scales' symbol on the left.

Website links:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Colin (Mendip Data Systems)
Access 2010 32-bit, Access 2016 32-bit & 64-bit, SQL Server Express 2014, Windows 10,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
isladogs is offline   Reply With Quote
Old 10-12-2019, 04:18 AM   #5
Pat_M
Newly Registered User
 
Join Date: Oct 2019
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
Pat_M is on a distinguished road
Re: Create Sharepoint Online folder from VBA (access 2016)

I only need to create the subfolder in sharepoint online. I can make use of a linked sharepoint list to access the contents of the folder afterwards.

So the sample code from the SO post should be all I need, but I am missing how to get it running:

strPostData = "{ '__metadata': { 'type': 'SP.Folder' }, 'ServerRelativeUrl': '/Shared Documents/Folder1'}"

'Set objXMLHTTP = New MSXML2.XMLHTTP
With objXMLHTTP
.Open "POST", url, False

.setRequestHeader "accept", "application/json;odata=verbose"
.setRequestHeader "Content-Type", "application/json;odata=verbose"
.send strPostData
strResponse = .
responseText
End With
Pat_M is offline   Reply With Quote
Old 10-12-2019, 07:24 AM   #6
theDBguy
Iím here to help
 
theDBguy's Avatar
 
Join Date: Oct 2018
Location: SunnySandyEggo
Posts: 5,551
Thanks: 55
Thanked 1,226 Times in 1,207 Posts
theDBguy has a spectacular aura about theDBguy has a spectacular aura about
Re: Create Sharepoint Online folder from VBA (access 2016)

Hi. In some cases, it seems simply using the MKDIR command is enough. Have you tried it?

__________________
Just my 2 cents...

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
theDBguy is online now   Reply With Quote
Reply

Tags
sharepoint online , vba access 2016

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Front-end updater on SharePoint Online? CNorway General 3 05-24-2018 11:57 AM
Sharepoint online status with Access 2010 devo96 Modules & VBA 1 02-23-2018 07:29 AM
Can Access 2016 be used with sharepoint foundation 2013? shadowsedge General 0 05-19-2016 06:38 AM
importing Access 365 to Sharepoint online rv02 Access Web 0 07-07-2014 02:17 AM
Check Sharepoint Online Status (VBA/Access 2007) drjohn61 Modules & VBA 1 08-04-2012 04:43 PM




All times are GMT -8. The time now is 05:23 PM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World