## VbaProject::Protect(bool, const U16String\&) method


Protects or unprotects this VBA project.

```cpp
void Aspose::Cells::Vba::VbaProject::Protect(bool islockedForViewing, const U16String &password)
```


| Parameter | Type | Description |
| --- | --- | --- |
| islockedForViewing | bool | indicates whether locks project for viewing. |
| password | const U16String\& | If the value is null, unprotects this VBA project, otherwise projects the this VBA project. |
## Remarks



If islockedForViewing is true, the password could not be null. 
## See Also

* Class [Vector](../../../aspose.cells/vector/)
* Class [U16String](../../../aspose.cells/u16string/)
* Class [VbaProject](../)
* Namespace [Aspose::Cells::Vba](../../)
* Library [Aspose.Cells for C++](../../../)
## VbaProject::Protect(bool, const char16_t*) method


Protects or unprotects this VBA project.

```cpp
void Aspose::Cells::Vba::VbaProject::Protect(bool islockedForViewing, const char16_t *password)
```


| Parameter | Type | Description |
| --- | --- | --- |
| islockedForViewing | bool | indicates whether locks project for viewing. |
| password | const char16_t* | If the value is null, unprotects this VBA project, otherwise projects the this VBA project. |
## Remarks



If islockedForViewing is true, the password could not be null. 
## See Also

* Class [Vector](../../../aspose.cells/vector/)
* Class [VbaProject](../)
* Namespace [Aspose::Cells::Vba](../../)
* Library [Aspose.Cells for C++](../../../)
