> ## Documentation Index
> Fetch the complete documentation index at: https://jetxl.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Troubleshooting

> Symptoms, likely causes, and where to look next

Symptoms first, in the order people hit them.

<Note>
  Errors raised from the Rust core arrive as `OSError`, not `ValueError`. Catch `OSError` when you need to handle a failed write.
</Note>

## The file won't open

<AccordionGroup>
  <Accordion title="Excel says the workbook needs repairing" icon="file-circle-exclamation">
    Usually a malformed custom number format code, since Jetxl passes anything containing a digit straight through to Excel. Try the column formats one at a time, or switch to a [built-in name](/guides/number-formats) to confirm.

    Overlapping [table](/guides/tables) ranges cause the same symptom. Two tables covering any of the same cells makes Excel reject the workbook.
  </Accordion>

  <Accordion title="Nothing was written at all" icon="file-slash">
    Check for an exception you might be swallowing. Jetxl validates the schema before writing, so an unsupported column type raises rather than producing a partial file. See [Data types](/guides/data-types).
  </Accordion>
</AccordionGroup>

## A feature didn't appear

This is the most common class of problem, because several mistakes are dropped silently rather than raised.

<AccordionGroup>
  <Accordion title="A conditional format is missing entirely" icon="wand-sparkles">
    An unrecognized `rule_type` causes the whole rule to be dropped, with no error. Check the spelling against `cell_value`, `color_scale`, `data_bar` and `top10`.
  </Accordion>

  <Accordion title="A table is missing" icon="table-cells">
    A table dictionary missing a required key, such as `name`, is dropped the same way.
  </Accordion>

  <Accordion title="A color didn't apply" icon="palette">
    Jetxl drops colors it can't parse and writes the file anyway. Named colors such as `"red"` and three-digit shorthand such as `"F00"` are both dropped. Use six or eight hex digits. See [Conventions](/guides/conventions).
  </Accordion>

  <Accordion title="A conditional format highlights the wrong cells" icon="highlighter">
    Check the spelling of `operator`. An unrecognized value silently becomes `greater_than`, so `greater_then` gives you a working file with the wrong rule.
  </Accordion>
</AccordionGroup>

<Tip>
  After adding a conditional format, table or chart, open the file once and confirm it's there. A dropped feature looks identical to one you forgot to add.
</Tip>

## Something looks wrong

<AccordionGroup>
  <Accordion title="Percentages are 100x too big" icon="percent">
    Built-in percentage formats multiply by 100 for display. Store `0.15` for 15 percent rather than `15`.
  </Accordion>

  <Accordion title="A style landed one row off" icon="arrows-up-down">
    Indexing isn't uniform. `cell_styles`, `header_content` and table ranges use 1-based rows with 0-based columns, while chart and image positions are 0-based on both axes.
  </Accordion>

  <Accordion title="Some numbers came out blank" icon="0">
    `NaN` and infinity are written as empty cells, because neither is valid in the spreadsheet format. Fill them before writing if they carry meaning.
  </Accordion>

  <Accordion title="Text lost characters" icon="text-slash">
    Control characters other than tab, newline and carriage return are stripped, since they have no legal representation in the underlying XML. Scraped or legacy text is the usual source.
  </Accordion>

  <Accordion title="Dates show as numbers" icon="calendar">
    The cell holds a real date; it just has no format. Set `column_formats` to `"date"` or `"datetime"` for that column.
  </Accordion>

  <Accordion title="Headers aren't shaded" icon="heading">
    `styled_headers` applies bold only. There's no fill. Use `cell_styles` on the header row if you want a background color.
  </Accordion>

  <Accordion title="The write failed on a very large frame" icon="table-cells-large">
    Excel's grid stops at 1,048,576 rows and 16,384 columns, and Jetxl raises rather than truncating. The row limit counts the header, so a frame of exactly 1,048,576 rows is one over.
  </Accordion>
</AccordionGroup>

## It's slower than expected

<AccordionGroup>
  <Accordion title="auto_width on a large frame" icon="left-right">
    `auto_width` measures every row. On large exports set explicit `column_widths` instead. The project's own guidance is to disable auto-width for speed.
  </Accordion>

  <Accordion title="Using the dictionary functions" icon="box-archive">
    `write_sheet` reads Python lists rather than Arrow buffers and benchmarks at roughly twice the time. Switch to `write_sheet_arrow`.
  </Accordion>

  <Accordion title="More threads than sheets" icon="microchip">
    Parallelism is per sheet, so extra threads do nothing. Use `min(os.cpu_count(), len(sheets))`.
  </Accordion>
</AccordionGroup>

## It runs out of memory

The bytes functions hold the entire workbook in memory before returning it, which approaches a gigabyte at a million rows. Write to a file instead, or split the export across several files.

## Reporting a bug

<Warning>
  Jetxl is experimental, and combining several formatting parameters is where bugs are most likely. If something looks wrong, try removing optional parameters one at a time to find which pair interacts badly. That reduction is also the most useful thing to put in a bug report.
</Warning>

Open an issue on [GitHub](https://github.com/omarirfa/Jetxl/issues) with the Jetxl version, the DataFrame library and version, and a minimal failing example.
