baz16
08-03-2015, 04:55 AM
Hi, I am trying to create a folder automatically if it does not exist already in sharepoint, the below code works fine for a shared drive, i just replaced the Path name with the URL ("https:\\etc...), but I keep getting bad file. I have tried changing the / to \ but to no avail. Is there an easy way to create a folder on sharepoint using VBA from an excel userform (i suppose it doesn't really need to check if the file exists as it should never already exist, i just thought it would be best to cover it just in case). I don't want to save the excel sheet to the folder, just simply create the folder at this stage.
PTFolderName = Me.TextBox1.Value
If Dir("https://workspace.Test.com/uk/Fix%20and%20Recover/7_PMT_%20Attachments/2_PMT_Additional_Attachments/" & PTFolderName, vbDirectory) = "" Then
MkDir "//workspace.Test.com/uk/Fix%20and%20Recover/7_PMT_%20Attachments/2_PMT_Additional_Attachments/" & PTFolderName"
End If
Thanks
PTFolderName = Me.TextBox1.Value
If Dir("https://workspace.Test.com/uk/Fix%20and%20Recover/7_PMT_%20Attachments/2_PMT_Additional_Attachments/" & PTFolderName, vbDirectory) = "" Then
MkDir "//workspace.Test.com/uk/Fix%20and%20Recover/7_PMT_%20Attachments/2_PMT_Additional_Attachments/" & PTFolderName"
End If
Thanks