Home Documentation Writing Reading Pictures1 Pictures2 Formulas DateTime SheetByName
Merging Grouping InsertRowCol NumFormats Formats Fonts Buffer1 Buffer2 Copying TopNFilter
Sorting StringFilter NumberFilter FilterByValues Protection Replacing RichString BeginWith
ColorScale OpRule AltRows
Merging Grouping InsertRowCol NumFormats Formats Fonts Buffer1 Buffer2 Copying TopNFilter
Sorting StringFilter NumberFilter FilterByValues Protection Replacing RichString BeginWith
ColorScale OpRule AltRows
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; }