Working with Validation

Overview

WorkbookValidator is a save-time structural check, not an Excel-style data-validation feature for cell input (such as dropdown lists or input restrictions) — the library’s API surface does not expose that kind of cell-level validation.


Structural Validation Before Save

WorkbookValidator::ValidateForSave($workbookModel, $packageModel) runs structural checks against the in-memory workbook and package model to confirm the result will be a specification-conformant OpenXML package before Workbook::Save() writes it out.

Validation Messages

Each check produces a ValidationMessage with a Code, a Message, and a Severity drawn from ValidationMessageSeverity: Info, Warning, or Error.


API Reference Summary

Class/MethodDescription
WorkbookValidator::ValidateForSave($workbookModel, $packageModel)Runs structural validation before save
ValidationMessageA single validation result (Code, Message, Severity)
ValidationMessageSeverityInfo | Warning | Error

See Also