Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
You can protect or unprotect the shared workbook with Microsoft Excel as shown in the following screenshot. Aspose.Cells also supports this feature with the Workbook::ProtectSharedWorkbook() and Workbook::UnprotectSharedWorkbook() methods.

The following sample code creates a workbook, protects it while enabling sharing, and saves it as the output Excel file. The screenshot shows that when you try to unprotect it, Microsoft Excel prompts you to enter the password to unprotect it.

#include <iostream>
#include "Aspose.Cells.h"
using namespace Aspose::Cells;
int main()
{
Aspose::Cells::Startup();
// Create empty Excel file
Workbook wb;
// Protect the Shared Workbook with Password
wb.ProtectSharedWorkbook(u"1234");
// Uncomment this line to Unprotect the Shared Workbook
// wb.UnprotectSharedWorkbook(u"1234");
// Save the output Excel file
wb.Save(u"outputProtectSharedWorkbook.xlsx");
std::cout << "Shared workbook protection applied successfully!" << std::endl;
Aspose::Cells::Cleanup();
}
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.