+ 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
    161

    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
    Office 365 ProPlus
    Posts
    5,882

    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
    161

    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
    Office 365 ProPlus
    Posts
    5,882

    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
    161

    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
    Office 365 ProPlus
    Posts
    5,882

    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
    161

    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)

Similar Threads

  1. Excel file(xlsx or xlsm) auto upload on SharePoint link
    By PaulM100 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-15-2018, 02:38 AM
  2. Upload file from ms access into sharepoint
    By waka in forum Access Tables & Databases
    Replies: 1
    Last Post: 06-18-2015, 04:29 AM
  3. Upload file from mS access into sharepoint
    By waka in forum Access Programming / VBA / Macros
    Replies: 0
    Last Post: 06-18-2015, 04:24 AM
  4. Upload to Sharepoint
    By joey1984 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-09-2013, 09:54 AM
  5. Upload a Excel file to a SharePoint
    By sur in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-10-2012, 10:54 PM
  6. Upload Excel file to Sharepoint using Macro
    By gtg653t in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-10-2008, 10:43 AM
  7. Upload to sharepoint
    By Lp12 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-17-2006, 01:55 PM

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