|
2.13. Delete or Unlink a Shared ListYou 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. 2.13.1. How to do itFrom 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:
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 list. You can avoid this by unlinking the worksheet list. 2.13.2. How it worksThe Lists web service provides a direct interface to lists stored on the SharePoint server. Excel actually wraps those web service method calls to provide its list-sharing features and objects. 2.13.3. What about...The following section tells you more about the Lists web service. |
|