Update a Shared List

There are several ways to update a shared list:

  • Refreshing discards local changes and updates the (local) worksheet list with data from the SharePoint server.

  • Synchronizing updates both the worksheet list and the SharePoint list. Conflicts between local edits and edits from other users can be resolved by the user who is synchronizing.

Note

If you’re not upto- date, there’s no point in sharing.

How to do it

From Excel, use the Data → List menu to refresh or synchronize a list.

From code, use the ListObject’s Refresh method to discard changes to the list on the worksheet and refresh it with data from the SharePoint server:

   lst.Refresh

Use the UpdateChanges method to synchronize the worksheet list with the SharePoint list:

   lst.UpdateChanges xlListConflictDialog

If two authors modify the same item in a list, a conflict will occur when the second author updates his list. The iConflictType argument determines what happens when a conflict occurs. Possible settings are:

SettingDescription

xlListConflictDialog

Displays the Resolve Conflicts and Errors dialog box to resolve the conflict (this the default).

xlListConflictRetryAllConflicts

Replaces conflicting data on the SharePoint server with data from the worksheet.

xlListConflictDiscardAllConflicts

Replaces conflicting data on the worksheet with updates from the SharePoint server.

xlListConflictError

Updates the items that do not conflict and generates an error—“Cannot update the ...

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.