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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Opening all Files in a Shared Workspace

Status
Not open for further replies.

mlohmac

MIS
Oct 28, 2002
10
Hello All,

This problem is driving me crazy. Seems like it should be easy to do but maybe I am just showing my ignorance. Here is what I am trying to do:

From Excel I want to open all the files that reside in a SharePoint document library. I want to do this when a user clicks a button in a user form. So far this is what I have come up with:

Private Sub cmdConsolidate_Click()
Dim swsWorkspace As Office.SharedWorkspace
Dim i As Long
Set swsWorkspace = ActiveWorkbook.SharedWorkspace
For i = 1 To (swsWorkspace.Files.Count)
Application.Workbooks.Open swsWorkspace.Files.Item(i)
Next i
End Sub

This works like a charm but it requires the user to open a file in the document library first in order to get the active document to be the active workbook.

Does anyone know how I can open all the files in a SharePoint document library without having the user open one of the files in the library first?

Thanks!

-Cameron Holm

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top