Kommentar
Åtkomst till den här sidan kräver auktorisering. Du kan prova att logga in eller ändra kataloger.
Åtkomst till den här sidan kräver auktorisering. Du kan prova att ändra kataloger.
Gets a Microsoft.Office.Core.SharedWorkspace that represents the Document Workspace in which the workbook is located.
Namespace: Microsoft.Office.Tools.Excel
Assembly: Microsoft.Office.Tools.Excel.v9.0 (in Microsoft.Office.Tools.Excel.v9.0.dll)
Syntax
'Declaration
<BrowsableAttribute(False)> _
Public ReadOnly Property SharedWorkspace As SharedWorkspace
'Usage
Dim instance As Workbook
Dim value As SharedWorkspace
value = instance.SharedWorkspace
[BrowsableAttribute(false)]
public SharedWorkspace SharedWorkspace { get; }
[BrowsableAttribute(false)]
public:
property SharedWorkspace^ SharedWorkspace {
SharedWorkspace^ get ();
}
public function get SharedWorkspace () : SharedWorkspace
Property Value
Type: SharedWorkspace
A Microsoft.Office.Core.SharedWorkspace that represents the Document Workspace in which the workbook is located.
Examples
The following code example uses the SharedWorkspace property to determine whether the current workbook is part of a Document Workspace. If the workbook is part of a Document Workspace, then the example uses the Sync property to display the user who last changed the document.
This example is for a document-level customization.
Private Sub DisplayLastChangeBy()
If Me.SharedWorkspace.Connected Then
MsgBox("Last changed by: " & _
Me.Sync.WorkspaceLastChangedBy)
Else
MsgBox("The current document is not connected " & _
"to a shared workspace.")
End If
End Sub
private void DisplayLastChangeBy()
{
if (this.SharedWorkspace.Connected)
{
MessageBox.Show("Last changed by: " +
this.Sync.WorkspaceLastChangedBy);
}
else
{
MessageBox.Show("The current document is not connected " +
"to a shared workspace.");
}
}
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.