다음을 통해 공유


Workbook.CheckInWithVersion Method (Excel)

Saves a workbook to a server from a local computer, and sets the local workbook to read-only so that it cannot be edited locally.

Version Information

추가된 버전: Excel 2007

Syntax

.CheckInWithVersion(SaveChanges, Comments, MakePublic, VersionType)

A variable that returns a Workbook object.

Parameters

Name

Required/Optional

Data Type

Description

SaveChanges

선택

Variant

True to save the workbook to the server location. The default is True.

Comments

선택

Variant

Comments for the revision of the workbook being checked in (applies only if SaveChanges is set to True).

MakePublic

선택

Variant

True to allow the user to publish the workbook after it is checked in.

VersionType

선택

Variant

Specifies versioning information for the workbook.

Return Value

Nothing

Remarks

Setting the MakePublic parameter to True submits the workbook for the approval process, which can eventually result in a version of the workbook being published to users with read-only rights to the workbook (applies only if SaveChanges is set to True).

To take advantage of the collaboration features built into Microsoft Excel, documents must be stored on a Microsoft SharePoint Server.

Example

The following example uses the CanCheckIn method to determine whether the workbook has been stored on a Microsoft SharePoint Server. If the workbook has been stored on a server, the example calls the CheckInWithVersion method to check in the workbook along with the specified comments and version number, save changes to the server location, and submit the workbook for the approval process.

This example is for a workbook-level customization.

Private Sub WorkbookCheckIn() 
 If ActiveWorkbook.CanCheckIn Then 
 ActiveWorkbook.CheckInWithVersion _ 
 True, _ 
 "My updates.", _ 
 True, _ 
 XlCheckInVersionType.xlCheckInMinorVersion 
 Else 
 MessageBox.Show ("This workbook cannot be checked in") 
 End If 
End Sub

참고 항목

개념

Workbook Object

Workbook Object Members