Share via


Workbook Methods (Excel)

GitHub-Mark-64px

Contribute to this content

Use GitHub to suggest and submit changes. See our guidelines for contributing to VBA documentation.

Methods

Name

Description

AcceptAllChanges

Accepts all changes in the specified shared workbook.

Activate

Activates the first window associated with the workbook.

AddToFavorites

Adds a shortcut to the workbook or hyperlink to the Favorites folder.

ApplyTheme

Applies the specified theme to the current workbook.

BreakLink

Converts formulas linked to other Microsoft Excel sources or OLE sources to values.

CanCheckIn

True if Microsoft Excel can check in a specified workbook to a server. Read/write Boolean.

ChangeFileAccess

Changes the access permissions for the workbook. This may require an updated version to be loaded from the disk.

ChangeLink

Changes a link from one document to another.

CheckIn

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.

CheckInWithVersion

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.

Close

Closes the object.

DeleteNumberFormat

Deletes a custom number format from the workbook.

EnableConnections

The EnableConnections method allows developers to programmatically enable data connections within the workbook for the user.

EndReview

Terminates a review of a file that has been sent for review using the SendForReview method.

ExclusiveAccess

Assigns the current user exclusive access to the workbook that's open as a shared list.

ExportAsFixedFormat

The ExportAsFixedFormat method is used to publish a workbook to either the PDF or XPS format.

FollowHyperlink

Displays a cached document, if it’s already been downloaded. Otherwise, this method resolves the hyperlink, downloads the target document, and displays the document in the appropriate application.

ForwardMailer

You have requested Help for a Visual Basic keyword used only on the Macintosh. For information about this keyword, consult the language reference Help included with Microsoft Office Macintosh Edition.

GetWorkflowTasks

Returns the collection of WorkflowTask objects for the specified workbook.

GetWorkflowTemplates

Returns the collection of WorkflowTemplate objects for the specified workbook.

HighlightChangesOptions

Controls how changes are shown in a shared workbook.

LinkInfo

Returns the link date and update status.

LinkSources

Returns an array of links in the workbook. The names in the array are the names of the linked documents, editions, or DDE or OLE servers. Returns Empty if there are no links.

LockServerFile

Locks the workbook on the server to prevent modification.

MergeWorkbook

Merges changes from one workbook into an open workbook.

NewWindow

Creates a new window or a copy of the specified window.

OpenLinks

Opens the supporting documents for a link or links.

PivotCaches

Returns a PivotCaches collection that represents all the PivotTable caches in the specified workbook. Read-only.

Post

Posts the specified workbook to a public folder. This method works only with a Microsoft Exchange client connected to a Microsoft Exchange server.

PrintOut

Prints the object.

PrintPreview

Shows a preview of the object as it would look when printed.

Protect

Protects a workbook so that it cannot be modified.

ProtectSharing

Saves the workbook and protects it for sharing.

PurgeChangeHistoryNow

Removes entries from the change log for the specified workbook.

RefreshAll

Refreshes all external data ranges and PivotTable reports in the specified workbook.

RejectAllChanges

Rejects all changes in the specified shared workbook.

ReloadAs

Reloads a workbook based on an HTML document, using the specified document encoding.

RemoveDocumentInformation

Removes all information of the specified type from the workbook.

RemoveUser

Disconnects the specified user from the shared workbook.

Reply

You have requested Help for a Visual Basic keyword used only on the Macintosh. For information about this keyword, consult the language reference Help included with Microsoft Office Macintosh Edition.

ReplyAll

You have requested Help for a Visual Basic keyword used only on the Macintosh. For information about this keyword, consult the language reference Help included with Microsoft Office Macintosh Edition.

ReplyWithChanges

Sends an e-mail message to the author of a workbook that has been sent out for review, notifying them that a reviewer has completed review of the workbook.

ResetColors

Resets the color palette to the default colors.

RunAutoMacros

Runs the Auto_Open, Auto_Close, Auto_Activate, or Auto_Deactivate macro attached to the workbook. This method is included for backward compatibility. For new Visual Basic code, you should use the Open, Close, Activate and Deactivate events instead of these macros.

Save

Saves changes to the specified workbook.

SaveAs

Saves changes to the workbook in a different file.

SaveAsXMLData

Exports the data that has been mapped to the specified XML schema map to an XML data file.

SaveCopyAs

Saves a copy of the workbook to a file but doesn't modify the open workbook in memory.

SendFaxOverInternet

Sends a worksheet as a fax to the specfied recipients.

SendForReview

Sends a workbook in an e-mail message for review to the specified recipients.

SendMail

Sends the workbook by using the installed mail system.

SendMailer

You have requested Help for a Visual Basic keyword used only on the Macintosh. For information about this keyword, consult the language reference Help included with Microsoft Office Macintosh Edition.

SetLinkOnData

Sets the name of a procedure that runs whenever a DDE link is updated.

SetPasswordEncryptionOptions

Sets the options for encrypting workbooks using passwords.

ToggleFormsDesign

The ToggleFormsDesign method is used to toggle Excel into Design Mode when using forms controls.

Unprotect

Removes protection from a sheet or workbook. This method has no effect if the sheet or workbook isn't protected.

UnprotectSharing

Turns off protection for sharing and saves the workbook.

UpdateFromFile

Updates a read-only workbook from the saved disk version of the workbook if the disk version is more recent than the copy of the workbook that is loaded in memory. If the disk copy hasn't changed since the workbook was loaded, the in-memory copy of the workbook isn't reloaded.

UpdateLink

Updates a Microsoft Excel, DDE, or OLE link (or links).

WebPagePreview

Displays a preview of the specified workbook as it would look if saved as a Web page.

XmlImport

Imports an XML data file into the current workbook.

XmlImportXml

Imports an XML data stream that has been previously loaded into memory. Excel uses the first qualifying map found or if the destination range is specified, Excel will automatically list the data.

CreateForecastSheet

If you have historical time-based data, you can use CreateForecastSheet to create a forecast. When you create a forecast, a new worksheet is created that contains a table of the historical and predicted values and a chart showing this. A forecast can help you predict things like future sales, inventory requirements, or consumer trends.