+ Reply to Thread
Results 1 to 7 of 7

VBA Upload saved file to SharePoint

  1. #1
    Forum Contributor
    Join Date
    08-22-2013
    Location
    Sheffield
    MS-Off Ver
    Excel 2010
    Posts
    114

    VBA Upload saved file to SharePoint

    Hi everyone,

    Racking my brains on why this keeps coming up as a Runtime error '76'? Path not found?

    Please Login or Register  to view this content.
    If i try and open the site individually from the VBA - it works... If it open the file individually from the VBA, it works...

    I've been googling it for about 3 hours I've tried loads of different code, none of which work... Tried adding different References, nothing worked Tried /'s and \'s also...

    **Also the file does exist in the location**

    Any help on this matter would be great!

    Thanks!
    Last edited by jsneak; 07-16-2019 at 12:08 PM.

  2. #2
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    2013, Office 365 ProPlus
    Posts
    4,908

    Re: VBA Upload saved file to SharePoint

    How is your SharePoint set up?

    Is it hosted on local server? Or is it SharePoint Online?

    If former, is it on single db backend which is housed in same server as SharePoint services?
    “Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something.”
    ― Robert A. Heinlein

  3. #3
    Forum Contributor
    Join Date
    08-22-2013
    Location
    Sheffield
    MS-Off Ver
    Excel 2010
    Posts
    114

    Re: VBA Upload saved file to SharePoint

    It's a SharePoint online - i took the full address out.

    It's really weird because when i ran it this morning it worked, thought awesome... Tried it later, came up with this error and i've literally not touched the code.

    One thing i have noticed, when i go onto the sharepoint - the actually website link half way across it says root folder, then a load of rubbish ... i copied it out into notepad and removed it, used that link on IE & Chrome and it loaded the same page - so i thought Ah, that will be it.... However it isn;t

  4. #4
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    2013, Office 365 ProPlus
    Posts
    4,908

    Re: VBA Upload saved file to SharePoint

    The path should then be something like...
    "https://companyname.sharepoint.com/sites/sitename/Shared Documents/filename.xlsb"

    If you need to find exact path to the file/folder. First load some document manually to the site.
    Then open the file in browser, and Edit Workbook -> Open in Excel (desktop app).
    Once the file is open in local Excel, go to File -> Info then click on Copy path button.

    Paste the result to text editor and remove "filename.xlsb?web=1" part. Remaining part is your path to SharePoint folder.
    Note that you must be logged in to SharePoint/Office 365 account on your Excel instance to be able to use it.

  5. #5
    Forum Contributor
    Join Date
    08-22-2013
    Location
    Sheffield
    MS-Off Ver
    Excel 2010
    Posts
    114

    Re: VBA Upload saved file to SharePoint

    Thanks for the reply, really appreciate it

    Just ran through what you said - unfortunately i got the same error made sure im logged into 365 too

    I'll send you a PM with the proper site address.. If you dont mind, could you have a look just to make sure?

  6. #6
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    2013, Office 365 ProPlus
    Posts
    4,908

    Re: VBA Upload saved file to SharePoint

    Oh, one thing you can try. Instead of using FileCopy.

    Try using Workbook.SaveAs to the SharePoint path.

    FYI - I'd not recommend sending sensitive link, even in PM You never know if I can be trusted.

  7. #7
    Forum Contributor
    Join Date
    08-22-2013
    Location
    Sheffield
    MS-Off Ver
    Excel 2010
    Posts
    114

    Re: VBA Upload saved file to SharePoint

    Thanks, ill give that a go...

    Tbh i don't think there is much that anyone could do because its got tons of permissions on it lol

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1