Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 553
Default Accessing Excel Documents on a SharePoint Site

Can anyone tell me how to access Excel Documents on a SharePoint site using
VBA.


Thanks

EM
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 553
Default Accessing Excel Documents on a SharePoint Site

I am trying to loop through my personal folder with the following code below.
The URL is what appears in the explorer bar when I go to my Personal folder
on the SharedPoint Site. However it fails on the line of code:

Set oFolder = oFSO.GetFolder(strPath)

What am I doing wrong?

Sub ListAllFilesInFolder()
Dim strPath As String
Dim oFSO As Object
Dim oFile As Object
Dim oFolder As Object
Dim N As Long
N = 1

strPath =
"http://mysite.cnpl.Aco.com/personal/username/Personal%20Documents/Forms/AllItems.aspx" '<<< CHANGE

Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oFolder = oFSO.GetFolder(strPath)
Cells(N, 1).Value = oFolder.Path
N = N + 1
For Each oFile In oFolder.Files
Cells(N, 2).Value = oFile.Name
N = N + 1
Next 'oFile

Set oFSO = Nothing
Set oFile = Nothing
Set oFolder = Nothing
End Sub

Thanks

EM

"ExcelMonkey" wrote:

Can anyone tell me how to access Excel Documents on a SharePoint site using
VBA.


Thanks

EM

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Loop through folder

This should work:
strPath =
"\\mysite.cnpl.Aco.com\personal\username\Personal% 20Documents"



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Synchronising Excel Documents Across SharePoint goobler Excel Discussion (Misc queries) 0 May 12th 10 03:14 PM
VBA Code to open an Excel file on a sharepoint site Vit[_2_] Excel Programming 4 September 4th 08 08:01 AM
Having problems saving pdf's from excel to a sharepoint site. Ben H. Excel Programming 2 October 16th 07 05:24 AM
Accessing word documents from Excel SueJB Excel Programming 2 November 3rd 05 09:41 PM
Shared Excel Documents and SharePoint RFischer Excel Discussion (Misc queries) 0 November 30th 04 06:25 PM


All times are GMT +1. The time now is 04:08 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"