It seems the macro does not tend to like the tables. This is ordinary each time you have to look into a cell to ensure what is the style.
according to me, here is a fix so that you are able to skip the tables , you need to replace the corresponding For/Next routine) :
thisElement = oEnum.nextElement
For i = 0 to uBound(inUse())
If thisElement.supportsService("com.sun.star.text.Paragraph") Then
If inUse(i) = thisElement.ParaStyleName then Exit Do