Use the Lists Web Service
SharePoint Services includes the Lists web service for getting at shared lists and their data directly. The Lists web service lets you perform tasks on the server that you cannot otherwise perform through Excel objects. Specifically, you can use the Lists web service to:
Add an attachment to a row in a list
Retrieve an attachment from a row in a list
Delete an attachment
Delete a list from a SharePoint server
Look up a list GUID
Perform queries
Note
I’m jumping ahead a bit here—web services are covered in Chapter 4. You need to know a bit about the Lists web service now because you can’t delete a list from SharePoint or add attachments without it.
How to do it
To use a web service from Visual Basic:
Install the Web Services Toolkit from Microsoft at http://www.microsoft.com/downloads .
Close and restart Excel.
Open the Visual Basic Editor and select Web References from the Tools menu. Visual Basic displays the Microsoft Office 2003 Web Services Toolkit references dialog.
The SharePoint web services reside in the _vti_bin folder of the SharePoint site. To use the Lists web service:
Display the Microsoft Office 2003 Web Services Toolkit as described above.
Select the Web Service URL option button and type the address of the address using this form: http:// http://sharepointURL/_vti_bin/lists.asmx
sharepointURL
.Click Search. The Toolkit should find the Lists web service and display it in the Search Results list.
Select the checkbox beside Lists ...
Get Excel 2003 Programming: A Developer's Notebook now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.