I've been given a workbook that had a tab copied into it from another workbook. The source workbook has evidently evolved over time, accumulating a large number of custom number formats and custom cell styles. (Over 15,000 if thisworkbook.styles.count is to be believed.)
I ran the below Excel 2007 VBA code to eliminate all but the default styles:
The new count of cell styles is 68.Please Login or Register to view this content.
The problem is that 19 custom styles are persistent and cannot be deleted.
Also, they cannot be selected from the styles dropdown list on the Home tab. Hovering over any of those custom styles makes the dropdown window disappear.
Examples:
_5-10-07 Mezz Sales
_Appendix_Wk 12 Est
_Appendix_Wk 13 Est Final
_Target Gaps 2
The error thrown by the code is:
Run-time error '1004:
Delete method of Style class failed
How can I delete those styles?
Bookmarks