Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Excel VBA functionality and SharePoint

75 views
Skip to first unread message

Filo

unread,
Jan 7, 2008, 10:01:00 PM1/7/08
to
Hello- Is it possible to use VBA to loop through files and folders published
to a SharePoint server? Does VBA lose any functionality if files are
published to a SharePoint server? Thanks.

Filo


Jim Cone

unread,
Jan 7, 2008, 11:04:05 PM1/7/08
to

Why don't you try it and let us know?...
'--
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 = "Path to Sharepoint Server" '<<< 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
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming - check out "List Files")

"Filo"
wrote in message

Filo

unread,
Jan 7, 2008, 11:30:00 PM1/7/08
to
Thanks Jim for the code. I wish I could test it, but unfortunately I don't
have SharePoint. I would like to ask the IT dept to install it only if I can
be certain I can manipulate the files with VBA as easily as with a standard
server. It would be awesome if it did work.

JNW

unread,
Feb 12, 2008, 6:33:01 PM2/12/08
to
So, I do have sharepoint installed, and tried Jim's code. It fails at the
Set oFolder line because it doesn't recognize what I input for the strPath.

What is the syntax of the path for Sharepoint. We have an https site that
we goto, but is that really the "Path to the Sharepoint Server" listed in
Jim's code?

Thanks.

my strPath is "https://client.us.com/clientname/default.aspx"
also tried "https://client.us.com/clientname/"
and "https://client.us.com/"

None worked.
--
JNW

Net_prof

unread,
Apr 25, 2008, 9:15:01 AM4/25/08
to
I have encountered a similar issue with trying to move files around different
Sharepoint Directories. After working on this for several weeks, as is (pure
VBA) will not work. The only way I have been able to work around this is by
using a product called WebDrive which uses WEBDAV technology to allow you to
map the Sharepoint Server Libraries/directories to a logical drive on your
local system. Then I have been able to successfully use either the fso
object or native VBA file commands (i.e. Kill).

Thanks,

net_prof

0 new messages