Results 1 to 2 of 2
  1. #1
    Baz16 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2015
    Posts
    11

    Creating a Folder in Sharepoint, if it does not already exist

    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)


    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.vodafone.com/uk/Clearview_Process_Library/Fix%20and%20Recover/7_PMT_%20Attachments/2_PMT_Additional_Attachments/" &
    PTFolderName

    End If

    Thanks

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    Are you sure the parent folders exist? if it's an HTTPS certificate wouldn't you have to provide credentials to make the directory somehow? If you are worried about the user having a location mapped differently across your network couldn't you simply use filesystemobject commands with an absolute path \\servername\etc\

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 4
    Last Post: 06-27-2013, 12:29 PM
  2. creating folder from Ms access in outlook
    By capitala in forum Programming
    Replies: 5
    Last Post: 03-08-2013, 10:05 PM
  3. VBA to create PDF and folder if doesn't exist!
    By crxftw in forum Programming
    Replies: 2
    Last Post: 08-08-2011, 08:53 AM
  4. Creating Viewport into a folder
    By dragondata in forum Access
    Replies: 2
    Last Post: 03-26-2010, 07:15 PM
  5. Replies: 0
    Last Post: 10-19-2009, 11:11 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums