excel_format_cells
Apply font, fill, border, alignment, and number formatting to a cell range in an Excel file. Each attribute can be set individually or left unchanged.
Instructions
Apply font, fill, border, alignment, and number-format to a range.
Each formatting argument is None by default and is treated as
"do not change". When every formatting argument is None,
the call is a true no-op: the file is not re-saved, so its
SHA256 and mtime are preserved (VAL-EXCEL-049).
Args:
path: Path to an existing .xlsx.
sheet: Name of the sheet to format.
cell_range: A cell reference ("A1") or a range
("A1:C3"). Column letters may be upper or lower case.
bold: True / False to set font.bold, or None
to leave it alone.
italic: Same semantics as bold for font.italic.
font_name: A font family name (e.g. "Arial").
font_size: Point size (e.g. 14).
font_color: Hex RGB string ("FF0000").
fill_color: Hex RGB string for the cell background.
border: Either a single style name applied to all four sides
("thin", "medium", "thick", "dashed",
"dotted", "double", "hair") or a dict mapping
"left" / "right" / "top" / "bottom" to
a style name.
alignment: "left" / "center" / "right" /
"justify" / "general" for Alignment.horizontal.
number_format: An Excel number format code (e.g. "0.00%",
"#,##0.00", "yyyy-mm-dd").
folder: Optional base folder for relative paths.
Returns:
{"ok": True}.
Raises:
OfficeMCPError: ERR_FILE_NOT_FOUND if the file is
missing, ERR_SHEET_NOT_FOUND for an unknown sheet,
ERR_CELL_PARSE for a malformed range,
ERR_INVALID_PARAMS for an unknown border style or
alignment, ERR_UNSUPPORTED_FMT for non-.xlsx
extensions.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| sheet | Yes | ||
| cell_range | Yes | ||
| bold | No | ||
| italic | No | ||
| font_name | No | ||
| font_size | No | ||
| font_color | No | ||
| fill_color | No | ||
| border | No | ||
| alignment | No | ||
| number_format | No | ||
| folder | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||