Results 1 to 7 of 7

VBA Upload saved file to SharePoint

Threaded View

  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?

        Dim SharepointAddress As String
        Dim LocalAddress As String
        Dim objNet As Object
        Dim FS As Object
        
    '    ActiveWorkbook.SaveCopyAs Filename:=Environ("USERPROFILE") & "/Downloads/" & Sheets("Main").ComboBox1.Value & " " & Sheets("Main").ComboBox2.Value & ".xlsb"
        
        SharepointAddress = "//sharepoint.com/sites/grp-logisticscc78/Shared Documents/C&H Command Centre Operations/KPI Dashboard\"
    
        LocalAddress = Environ("USERPROFILE") & "/Downloads/" & Sheets("Main").ComboBox1.Value & " " & Sheets("Main").ComboBox2.Value & ".xlsb"
        
        Set objNet = CreateObject("WScript.Network")
        Set FS = CreateObject("Scripting.FileSystemObject")
        
        If FS.FileExists(LocalAddress) Then
            FS.CopyFile LocalAddress, SharepointAddress
        
        End If
        Set objNet = Nothing
        Set FS = Nothing
    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.

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. [SOLVED] 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