I need to find a way to programmatically, using Excel VBA, create a folder in a Sharepoint Document Library. The Sharepoint Document Library already exist, and it has already one level of folders in it. The new sub-folder to be created will have a specific name which can be passed on by the Excel macro. Is it possible to construct an URL to the Sharepoint site that includes the command to create a sub-folder with a specific name?
1 Answer
Dim strDate As String
Dim strTime As String
strDate = Date
strTime = Time
strDate = Format(Now(), "mmmdd yyyy hh mm")
Dim strURL As String
''Copy and paste the URL of your sharePoint folder where you want to create another folder
strURL = "http://Your URL"
strURL = Replace(Replace(strURL, "http:", ""), "/", "\")
' MsgBox strDate, vbInformation
Dim Fld_r As String
Fld_r = strURL & strDate
MsgBox Fld_r, vbInformation
If Dir(Fld_r, vbDirectory) Then
MkDir (Fld_r)
DoEvents
End If
-
This doesn't seem to work with the latest version of the Office 365 & Sharepoint.– sifarNov 10, 2021 at 16:34