Skip to content

Latest commit

 

History

History
55 lines (37 loc) · 1.97 KB

Excel.Workbook.CheckIn.md

File metadata and controls

55 lines (37 loc) · 1.97 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
Workbook.CheckIn method (Excel)
vbaxl10.chm199204
vbaxl10.chm199204
Excel.Workbook.CheckIn
f9750086-aaa6-3b04-6b51-ebcadf6b1911
05/29/2019
medium

Workbook.CheckIn method (Excel)

Returns a workbook from a local computer to a server, and sets the local workbook to read-only so that it cannot be edited locally. Calling this method will also close the workbook.

Syntax

expression.CheckIn (SaveChanges, Comments, MakePublic)

expression A variable that represents a Workbook object.

Parameters

Name Required/Optional Data type Description
SaveChanges Optional Variant True saves changes and checks in the document. False returns the document to a checked-in status without saving revisions.
Comments Optional Variant Allows the user to enter check-in comments for the revision of the workbook being checked in (applies only if SaveChanges equals True).
MakePublic Optional Variant True allows the user to publish the workbook after it has been checked in. This 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 equals True).

Example

This example checks the server to see if the specified workbook can be checked in. If it can, the code saves and closes the workbook and checks it back in to the server.

Sub CheckInOut(strWkbCheckIn As String) 
 
 ' Determine if workbook can be checked in. 
 If Workbooks(strWkbCheckIn).CanCheckIn = True Then 
 Workbooks(strWkbCheckIn).CheckIn 
 MsgBox strWkbCheckIn & " has been checked in." 
 Else 
 MsgBox "This file cannot be checked in " & _ 
 "at this time. Please try again later." 
 End If 
 
End Sub

[!includeSupport and feedback]