Skip to content

Latest commit

 

History

History
66 lines (41 loc) · 2.43 KB

Excel.Workbook.CheckInWithVersion.md

File metadata and controls

66 lines (41 loc) · 2.43 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
Workbook.CheckInWithVersion method (Excel)
vbaxl10.chm199238
vbaxl10.chm199238
Excel.Workbook.CheckInWithVersion
3b37cea5-8795-bcbb-9c4b-d30b2b9a095e
05/29/2019
medium

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.

Syntax

expression.CheckInWithVersion (SaveChanges, Comments, MakePublic, VersionType)

expression A variable that returns a Workbook object.

Parameters

Name Required/Optional Data type Description
SaveChanges Optional Variant True to save the workbook to the server location. The default is True.
Comments Optional Variant Comments for the revision of the workbook being checked in (applies only if SaveChanges is set to True).
MakePublic Optional Variant True to allow the user to publish the workbook after it is checked in.
VersionType Optional 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 ThisWorkbook.CanCheckIn Then 
    ThisWorkbook.CheckInWithVersion True, "Changed sheet 1 and 2 etc...", True, XlCheckInVersionType.xlCheckInMinorVersion 
  Else 
    Msgbox "This workbook cannot be checked in"
  End If 
End Sub

[!includeSupport and feedback]