Insert comment
Function Prototype
insertComment(int $row, int $column, string $text): self
insertCommentOpt(int $row, int $column, string $text, array $options): self
showComment(): selfint $row
cell row
int $column
cell column
string $text
comment text
array $options
Optional extended comment settings. All keys are optional:
authorstring — comment author
font_namestring — font name
font_sizedouble — font size
colorint — background color (0xRRGGBBor aFormat::COLOR_*constant)
x_offsetint — horizontal pixel offset
y_offsetint — vertical pixel offset
x_scaledouble — horizontal scale factor
y_scaledouble — vertical scale factor
widthdouble — box width in pixels
heightdouble — box height in pixels
visibleint — comment display mode. Prefer the class constants below over raw integers:
Excel::COMMENT_DISPLAY_DEFAULT— follow the workbook-wide default
Excel::COMMENT_DISPLAY_HIDDEN— only shown on hover
Excel::COMMENT_DISPLAY_VISIBLE— always pinned open
start_rowint — anchor row of the box
start_colint — anchor column of the box
showComment() toggles the workbook-wide "show all comments" flag. Call it once to make every comment visible by default.
Example
Last updated