Sheet protection

This example shows how to protect a sheet with possibility to modify only two cells:

#include "libxl.h"

using namespace libxl;

int main()
{
    Book* book = xlCreateXMLBook();
    
    Sheet* sheet = book->addSheet(L"my");

    Format* format = book->addFormat();
    format->setLocked(false);

    sheet->writeStr(5, 1, L"this cell can be changed!", format);
    sheet->writeNum(6, 1, 100, format);

    sheet->setProtect(true);
   
    book->save(L"out.xlsx");

    book->release();
    
    return 0;
}