Spreadsheet conversion options

When converting spreadsheets, use these properties on ConvertOptions to control the Markdown table output.

Column and row truncation

from groupdocs.markdown import MarkdownConverter, ConvertOptions

def spreadsheet_truncation():
    """Convert a spreadsheet with column and row truncation limits."""

    # Step 1: Configure column and row limits
    options = ConvertOptions()
    options.max_columns = 8     # only include the first 8 columns
    options.max_rows = 50       # only include the first 50 data rows per sheet

    # Step 2: Convert with truncation options and save to a file
    MarkdownConverter.to_file("cost-analysis.xlsx", "spreadsheet-truncation.md", convert_options=options)

    # Truncated columns/rows show "..." indicators.
    # Warnings are reported in ConvertResult.warnings.

if __name__ == "__main__":
    spreadsheet_truncation()

cost-analysis.xlsx is sample file used in this example. Click here to download it.

## Summary

| Category | FY2024 | FY2025 | FY2026 |
| --- | --- | --- | --- |
| Parts and materials | $1,325,000.00 | $1,480,000.00 | $1,620,000.00 |
| Manufacturing equipment | $900,500.00 | $980,000.00 | $1,050,000.00 |
| Warehousing | $420,000.00 | $510,000.00 | $590,000.00 |
| Shipping | $380,000.00 | $445,000.00 | $520,000.00 |
| Marketing | $250,000.00 | $340,000.00 | $480,000.00 |
| R&D | $180,000.00 | $230,000.00 | $310,000.00 |
[TRUNCATED]

Download full output

Sheet separator and hidden sheets

from groupdocs.markdown import MarkdownConverter, ConvertOptions

def spreadsheet_sheets():
    """Convert a workbook with custom sheet separators and hidden sheet filtering."""

    # Step 1: Configure sheet separator and hidden sheet behavior
    options = ConvertOptions()
    options.sheet_separator = "\n---\n"      # horizontal rule between worksheets
    options.include_hidden_sheets = False    # skip hidden worksheets (default)

    # Step 2: Open the workbook with a context manager
    with MarkdownConverter("cost-analysis.xlsx") as converter:
        # Step 3: Convert and save the Markdown output
        converter.convert("spreadsheet-sheets.md", convert_options=options)

if __name__ == "__main__":
    spreadsheet_sheets()

cost-analysis.xlsx is sample file used in this example. Click here to download it.

## Summary

| Category | FY2024 | FY2025 | FY2026 |
| --- | --- | --- | --- |
| Parts and materials | $1,325,000.00 | $1,480,000.00 | $1,620,000.00 |
| Manufacturing equipment | $900,500.00 | $980,000.00 | $1,050,000.00 |
| Warehousing | $420,000.00 | $510,000.00 | $590,000.00 |
| Shipping | $380,000.00 | $445,000.00 | $520,000.00 |
| Marketing | $250,000.00 | $340,000.00 | $480,000.00 |
| R&D | $180,000.00 | $230,000.00 | $310,000.00 |
[TRUNCATED]

Download full output

Available options

PropertyTypeDefaultDescription
max_columnsint0 (unlimited)Maximum columns per table
max_rowsint0 (unlimited)Maximum data rows per worksheet
sheet_separatorstr"\n---\n"Separator inserted between worksheets
include_hidden_sheetsboolFalseWhether to include hidden worksheets
Close
Loading

Analyzing your prompt, please hold on...

An error occurred while retrieving the results. Please refresh the page and try again.