---
Product: Aspose.Cells
Platform: cpp
Page Type: reference
Canonical URL: https://reference.aspose.org/cells/cpp/xlsxworkbookworksheetprotection
---

# XlsxWorkbookWorksheetProtection

## Overview

`XlsxWorkbookWorksheetProtection` is a class in Aspose.Cells FOSS for C++.

Provides static methods for building and loading worksheet-protection XML elements.

This class declares 3 methods for XlsxWorkbookWorksheetProtection objects in C++ programs.
Available methods include: `BuildSheetProtectionElement`, `LoadWorksheetProtection`, `XlsxWorkbookWorksheetProtection`.
Public members are accessible to any C++ application after installing the Aspose.Cells FOSS for C++ package.

## Methods

| Signature | Description |
|-----------|-------------|
| `XlsxWorkbookWorksheetProtection()` | Calls XlsxWorkbookWorksheetProtection on this XlsxWorkbookWorksheetProtection instance. |
| `BuildSheetProtectionElement(worksheet: Core::WorksheetModel)` → `XmlElement` | Builds the sheetProtection element from the worksheet model's protection state. Returns a null XmlElement if the protection has no stored state. |
| `LoadWorksheetProtection(worksheetModel: Core::WorksheetModel, worksheetRoot: XmlElement, diagnostics: LoadDiagnostics, options: LoadOptions, sheetName: std::string_view)` | Loads worksheet protection attributes from the worksheet XML root into the model. |

## See Also

- [Aspose.Cells — Enterprise API Reference](https://reference.aspose.com/cells/)