Excel VBA functionality and SharePoint

F

Filo

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
 
J

Jim Cone

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
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
 
F

Filo

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.
 
J

JNW

N

Net_prof

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top