Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple Excel spreadsheets into master on SharePoint

Status
Not open for further replies.

sleepersol

Technical User
Jun 20, 2011
1
US
Hello all,
I am new to the programming world and even newer to VBA and SharePoint. I am attempting to write a VBA script which will take the information from a number of spreadsheet templates which are stored on SharePoint and combine them into a master template spreadsheet which will also be stored on SharePoint. I can get the path to work when it is a file on my computer but it will not find the file when I enter the path to the SharePoint file that I get from the properties tab. It states that it is a bad file name or number. Any help

Code:
'This is how I have it mapped to the file on my computer
    p = "D:\Users\yckpb\documents" 'This will be the W&I BU path
    f = "W&I.xls" 'file
    s = "Delivery" 'sheet
    For r = 6 To 8
        For c = 1 To 49
            a = Cells(r, c).Address 'reference
            Cells((r + nextCell), c) = GetValue(p, f, s, a)
        Next c
    Next r

There are spaces in between the words in the file name. This is how it was listed in the properties page. I tried it with and without the spaces put in
Code:
'This is how I attempted to map it to the file on SharePoint
'I removed some of the letters in the path for safety
    p = "[URL unfurl="true"]http://a...3/s...s/w...p/H../L.../C../S...e%20T...g%"[/URL] 
    f = "Trng%20Plan%20MASTERR%20Template%2005_17_2011.xls" 'file
    s = "Delivery" 'sheet
    For r = 6 To 8
        For c = 1 To 49
            a = Cells(r, c).Address 'reference
            Cells((r + nextCell), c) = GetValue(p, f, s, a)
        Next c
    Next r

Thanks in advance
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top