Strip junk styles
Location on ribbon: Tab DVD Addin → Group Cells and Rows
Command ID: btnDeleteCellStyles
What it does
The command opens an Excel file on disk (an xlsx is just a zip) and strips the junk Cell Styles out of xl/styles.xml — every cellStyle entry that is not one of Excel's built-in styles. These pile up when sheets are copied back and forth between workbooks, leaving a Cell Styles gallery thousands of entries long, a bloated file and painfully slow opening.
Use it when a quantity or programme workbook received from another party takes a minute to open, scrolls in jerks, or when Excel reports "Too many different cell formats".
How to use
- Close the file you want to clean in Excel — the command rewrites the file on disk, so it must not be open.
- Click DVD Addin → Cells and Rows → Strip junk styles.
- A file picker titled "Pick xlsx file" appears, filtered to
*.xlsx; *.xlsm; *.xlam. Select one file and click OK. - The command processes the file and reports the result: "Removed n junk styles" or "No junk styles found".
- Reopen the file and check Home → Cell Styles — the gallery is back to normal.
Example
Construction programme - Package 02.xlsx is 42 MB and takes over a minute to open because sheets from six subcontractors were merged into it. Close the file, run the command, pick the file in the dialog — the message reads "Removed 3,874 junk styles". Reopen it: the Cell Styles gallery holds only Excel's standard styles and the file opens in a few seconds.
Notes
- The command overwrites the original file in place, makes no backup and cannot be undone — copy the file first when working on signed records.
- A file currently open in Excel is refused with a message asking you to close the workbook first (OneDrive-synced files are matched by their local path too).
- Only
.xlsx,.xlsmand.xlamare supported. Legacy.xlsfiles must be saved as.xlsxfirst. - Only the surplus style definitions are removed; direct cell formatting (font, fill, borders) is untouched.
- If the file has no
xl/styles.xmlor no junk styles, the command reports that and leaves the file unchanged.
Related
- Delete error Defined Names — clears broken named ranges, the other half of slimming a file down.
- Delete unused formats — shrinks the used range of the open sheet.
- Sync format — re-standardise formatting once the styles are cleaned.