Name
listobject.UpdateChanges([iConflictType])
Synopsis
Synchronizes the shared list on a worksheet with the list on the SharePoint server. The setting of iConflictType determines how list items with changes on both the worksheet and SharePoint server are handled.
|
Setting |
Description |
|---|---|
|
xlListConflictDialog |
Displays the Resolve Conflicts and Errors dialog box to resolve the conflict (this is 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 list to Windows SharePoint Services,” leaving the conflicting items unchanged. |
If the worksheet list is not shared, UpdateChanges causes an error.
The following code synchronizes a list and overwrites conflicting items with the worksheet version of the item (local version wins):
Sub SyncLocalWins( )
Dim ws As Worksheet, lst As ListObject
Set ws = ActiveSheet
Set lst = ws.ListObjects("Test List")
lst.UpdateChanges xlListConflictRetryAllConflicts
End SubThe following code synchronizes a list and overwrites conflicting items with the SharePoint version of the item (server version wins):
Sub SyncServerWins( ) Dim ws As Worksheet, lst As ListObject Set ws = ActiveSheet Set lst = ws.ListObjects("Test List") lst.UpdateChanges xlListConflictDiscardAllConflicts ...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.
Read now
Unlock full access