Application.WorkbookSync Event

Excel Developer Reference

Occurs when the local copy of a workbook that is part of a Document Workspace is synchronized with the copy on the server.

Syntax

expression.WorkbookSync(Wb, SyncEventType)

expression   A variable that represents an Application object.

Parameters

Name Required/Optional Data Type Description
Wb Required Workbook The workbook being synchronized.
SyncEventType Required MsoSyncEventType The status of the workbook synchronization.

Return Value
Nothing

Remarks

MsoSyncEventType can be one of the following MsoSyncEventType constants:

msoSyncEventDownloadFailed
msoSyncEventDownloadInitiated
msoSyncEventDownloadNoChange
msoSyncEventDownloadSucceeded
msoSyncEventOffline
msoSyncEventUploadFailed
msoSyncEventUploadInitiated
msoSyncEventUploadSucceeded

Example

The following example displays a message if the synchronization of a workbook in a Document Workspace fails.

Visual Basic for Applications
  Private Sub app_WorkbookSync(ByVal Wb As Workbook, _
        ByVal SyncEventType As Office.MsoSyncEventType)
    
    If SyncEventType = msoSyncEventDownloadFailed Or _
            SyncEventType = msoSyncEventUploadFailed Then
            
        MsgBox "Workbook synchronization failed. " & _
            "Please contact your administrator " & vbCrLf & _
            "or try again later."
    
    End If

End Sub

See Also