You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Add sheet tab state with cross-sheet validation
xl_sheet() gains active, selected, visible and first_tab, reaching
worksheet_activate, worksheet_select, worksheet_hide and
worksheet_set_first_sheet.
These are the first worksheet settings whose rules span the whole workbook, so
unlike everything else in the sheet plan they cannot be checked one sheet at a
time. Excel requires that a hidden sheet is neither active nor selected, that
at most one sheet is active, that the first sheet is not hidden unless another
is made active, and that at least one sheet stays visible. libxlsxwriter
enforces none of them -- hide, activate and select all return void and simply
set a flag -- so a bad combination would produce a workbook Excel cannot open,
with no diagnostic.
.resolve_sheet_visibility() checks all four rules in write_xlsx(), where every
sheet is in scope, and names the sheet at fault. Plain data frames carry no tab
settings and are treated as unset throughout.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* Add hide_zero, right_to_left, selection and top_left
xl_sheet() gains four more view settings, reaching worksheet_hide_zero,
worksheet_right_to_left, worksheet_set_selection and
worksheet_set_top_left_cell. selection and top_left go through the shared range
resolver, so they take an Excel reference or a list(rows =, cols =) spec like
every other range argument.
Excel encodes which cell of a selection is active by the order its corners are
given, so worksheet_set_selection(6, 6, 3, 3) means "G7 to D4". writexl does
not expose that: the shared resolver rejects an inverted range, which is right
for every other caller, and one strict range parser is worth more than a niche
capability. The active cell is therefore always the range's top-left corner,
which is documented and covered by a test that pins the error.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* Add split panes, converting from a cell reference
worksheet_split_panes() does not take a row and a column. Both arguments are
distances, in the units Excel uses for row height and column width, and the two
units differ from each other -- 15 means one default row, 8.43 one default
column. Passing 1 for "one row" would put the split a fifteenth of the way down
the first row, silently.
xl_sheet(split =) therefore takes a cell reference, as freeze does, and
converts: the distance above the split is the summed height of the rows before
it, the distance to its left the summed width of the columns before it. The
sums use the sheet's real geometry -- header row height, xl_row_spec() heights,
xl_col_spec() widths and auto_colwidth results -- so a split lands where it was
asked for on a sheet whose rows or columns have been resized, rather than only
on a default one. Tests pin that sensitivity in both directions.
list(vertical =, horizontal =) still accepts the raw units. split and freeze
together is an error, since Excel supports one or the other.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* Document sheet view and navigation in the vignette and NEWS
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
0 commit comments