Name

worksheet.Protect([Password], [DrawingObjects], [Contents], [Scenarios], [UserInterfaceOnly], [AllowFormattingCells], [AllowFormattingColumns], [AllowFormattingRows], [ AllowInsertingColumns], [ AllowInsertingRows], [AllowInsertingHyperlinks], [ AllowDeletingColumns], [ AllowDeletingRows], [AllowSorting], [AllowFiltering], [AllowUsingPivotTables])

Synopsis

Prevents changes to a worksheet.

Argument

Settings

Password

A case-sensitive password string.

DrawingObjects

True prevents changes to shapes.

Contents

True prevents changes to the contents of cells.

Scenarios

True prevents changes to scenarios.

UserInterfaceOnly

True prevents changes to the user interface, but not macros.

AllowFormattingCells

True allows formatting changes to cells.

AllowFormattingColumns

True allows formatting changes to columns.

AllowFormattingRows

True allows formatting changes to rows.

AllowInsertingColumns

True allows inserting of columns.

AllowInsertingRows

True allows inserting of rows.

AllowInsertingHyperlinks

True allows inserting of hyperlinks.

AllowDeletingColumns

True allows deleting of columns.

AllowDeletingRows

True allows deleting of rows.

AllowSorting

True allows sorting on the worksheet.

AllowFiltering

True allows filtering on the worksheet.

AllowUsingPivotTables

True allows pivot tables on the worksheet.

Get Programming Excel with VBA and .NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.