Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Try this macro

Sub removeExcelStyles
Dim oStyleFamilies As Variant
Dim oStyle As Variant
Dim oElementNames As Variant
Dim i As Long 
Dim sTmp As String 
    oStyleFamilies = ThisComponent.getStyleFamilies()
    oStyle = oStyleFamilies.getByName("CellStyles")
    oElementNames = oStyle.getElementNames()
    For i = LBound(oElementNames) To UBound(oElementNames)
        If Left(oElementNames(i), Len("Excel_CondFormat_"))="Excel_CondFormat_" Then oStyle.removeByName(oElementNames(i))
    Next i
End Sub

And do not save your spreadsheet as an Excel file, use the ODF format - in this case, the new extra formats will not occur every time you save