Skip to Main Content
Excel 2003 Programming: A Developer's Notebook
book

Excel 2003 Programming: A Developer's Notebook

by Jeff Webb
August 2004
Intermediate to advanced content levelIntermediate to advanced
312 pages
8h 30m
English
O'Reilly Media, Inc.
Content preview from Excel 2003 Programming: A Developer's Notebook

Delete or Unlink a Shared List

You can remove a list or remove the link between the worksheet list and the SharePoint list through Excel or through code. Deleting a list from the server is a little trickier, however.

Note

As with workspaces, removing and unlinking lists from SharePoint is a basic management task. You need to know this stuff.

How to do it

From Excel, use the List menu to unlink or convert a list to a range. To delete it from the worksheet, select the list and use Clear All.

From code, use these ListObject methods to unlink, unlist, or delete a list:

MethodUse to

Unlink

Remove the link between the worksheet list and the SharePoint list

Unlist

Convert the worksheet list to a range, preserving the list’s data

Delete

Delete the worksheet list and all its data

Once you have unlinked a list, you can’t relink it. To re-establish the link, you must delete the list and insert it back onto the worksheet from the SharePoint list.

All of these methods affect only the worksheet list. The SharePoint list can only be deleted using the SharePoint site or the Lists web service. To delete the SharePoint list from code, create a web reference to the Lists web service and use the following DeleteList method:

   Dim lws As New clsws_Lists  ' Requires Web reference to 
   SharePoint 
Lists.asmx
   lws.wsm_DeleteList ("Excel Objects")

If you delete a SharePoint list, but not the worksheet list that shares it, you get an error when you attempt to refresh or update the worksheet ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Microsoft® Office Excel 2003 Programming Inside Out

Microsoft® Office Excel 2003 Programming Inside Out

Curtis Frye, Wayne S. Freeze, Felicia K. Buckingham
Excel® 2007 VBA Programmer's Reference

Excel® 2007 VBA Programmer's Reference

John Green, Stephen Bullen, Rob Bovey, Michael Alexander
Office 2003 XML

Office 2003 XML

Simon St. Laurent, Mary McRae, Evan Lenz

Publisher Resources

ISBN: 0596007671Supplemental ContentCatalog PageErrata