Excel Performance Problems

Fix Excel Removing Data Validation from Large Apache POI Workbooks

Olivia MillerOlivia Miller Nov 18, 2026 869 views

Question details

The user needs Excel to retain data validation rules in a large workbook generated with Apache POI.

Fix Excel Removing Data Validation from Large Apache POI Workbooks
Product
Microsoft Excel and Apache POI
Device & OS
not provided
Scenario
An Apache POI workbook contains approximately 80,000 rows, two validated columns, and multiple lookup lists.
Observed behavior
Excel repairs the large workbook by removing data validation rules, while a smaller workbook opens correctly.
Before you start

Check Excel's repair message or log for the affected worksheet and validation records. Identify whether cells share the same validation rule or need different lookup lists before consolidating them.

Solution 1Recommended

Consolidate Apache POI data validation rules

Use fewer validation records when many cells share the same list or condition.

A large number of individual validation references can contribute to workbook repair. Consolidation preserves the intended behavior only when the cells in a combined range use the same rule.

1
Review generated rules

In the Apache POI generation code, find calls to createValidation and addValidationData. Check whether the code creates a separate rule for each row.

2
Apply rules to ranges

Use CellRangeAddressList to define a contiguous range and create one validation for that range instead of one per cell. Create separate rules for columns or groups that require different conditions.

3
Simplify list sources

Put lookup values in worksheet ranges, then use workbook.createName() to define names for those ranges. In the validation helper, use createFormulaListConstraint with the appropriate name instead of duplicating long list definitions.

4
Test the workbook

Write the revised workbook with Apache POI, open it in Excel, and check Data > Data Validation on representative cells in both columns. Confirm that Excel no longer reports a repair and that the expected lists appear.

Consolidate Apache POI data validation rules
Keep distinct rules separate: If lookup lists vary by row, group only cells with identical validation behavior or retain separate rules where needed.
Free Microsoft Office alternative

Work with Excel-compatible spreadsheets in WPS Office

WPS Office is a free, lightweight Office alternative with a familiar spreadsheet interface. Open and edit Excel-format files as you move between applications; use Excel and Apache POI troubleshooting to resolve Excel-specific repair issues.

Open and edit Microsoft Excel XLSX and XLS spreadsheetsWork with spreadsheet data validation and drop-down listsUse a familiar interface for everyday spreadsheet tasksMove existing Office files into a lightweight, free suite
microsoft office alternative - wps office

Frequently Asked Questions

Does having 80,000 rows alone cause Excel to remove validation?

Not necessarily. Excel worksheets support up to 1,048,576 rows. The number or structure of validation records, their references, or other generated XML may be involved; check Excel's repair log to investigate.

How can I apply the same validation to an entire range with Apache POI?

Define the target cells with CellRangeAddressList, create a constraint with the sheet's data validation helper, and add the resulting validation to the sheet. Use separate rules when cells require different conditions.

Where can I check a validation rule in Excel?

Select a representative cell and open Data > Data Validation. Check the validation type and source, then test the drop-down if the rule uses a list.

Can a named range help with validation lists?

Yes. Store the lookup values in a worksheet range, define a workbook name for it, and use that name as the list-validation source. Verify that the name and its reference are valid in the generated workbook.

What if Excel still removes the rules after I combine them?

Inspect the repair log and the affected worksheet XML inside the XLSX archive. Generate smaller test files to isolate problematic rules or references, and consider splitting the data or simplifying the lookup structure.