WorkbookBase.CanCheckIn Method
Gets a value that indicates whether Microsoft Office Excel can check in the workbook to a server.
Namespace: Microsoft.Office.Tools.Excel
Assembly: Microsoft.Office.Tools.Excel.v4.0.Utilities (in Microsoft.Office.Tools.Excel.v4.0.Utilities.dll)
Syntax
'Declaration
Public Function CanCheckIn As Boolean
public bool CanCheckIn()
Return Value
Type: System.Boolean
true if Microsoft Office Excel can check in the workbook to a server; otherwise, false.
Examples
The following code example uses the CanCheckIn method to determine whether Microsoft Office Excel can check in the current workbook to a server. If the workbook can be checked in, then the example uses the CheckIn method to save revisions and check in the current workbook.
This example is for a document-level customization.
Private Sub WorkbookCheckIn()
' Determine if workbook can be checked in.
If Me.CanCheckIn() Then
Me.CheckIn(True, "Updates.", True)
MsgBox(Me.Name & " was checked in.")
Else
MsgBox(Me.Name & " cannot be checked in.")
End If
End Sub
private void WorkbookCheckIn()
{
// Determine if workbook can be checked in.
if (this.CanCheckIn())
{
this.CheckIn(true, "Updates.", true);
MessageBox.Show(this.Name + " was checked in.");
}
else
{
MessageBox.Show(this.Name + " cannot be checked in.");
}
}
.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.