Issue
HTML fields display with HTML Tags when exported and rendered in Excel format from List view:
- Navigate to any list view which has an HTML Field.
- Right-click on the headers
- Export > Excel (.xlsx)
- Observe the content of the row after downloading it into the Excel file.
Release
All releases
Cause
This ability to hide HTML Tags is currently not a part of the product.
Resolution
Use Visual Basic Editor in Excel to clean the exported content.
The code to change a column from HTML to plain text can be something like this:
Sub StripTags()
Dim cell As Range
Dim s As String
Dim asWd() As String
Dim iWd As Long
For Each cell In Intersect(Selection.Cells, ActiveSheet.UsedRange)
s = Replace(cell.Value, Chr(160), " ")
s = Replace(s, ">", "<")
s = Replace(s, vbCr, vbLf)
asWd = Split(s, "<")
s = vbNullString
For iWd = 0 To UBound(asWd) Step 2
s = s & " " & asWd(iWd)
Next iWd
Do While InStr(s, vbLf & " ")
s = Replace(s, vbLf & " ", vbLf)
Loop
Do While InStr(s, vbLf & vbLf)
s = Replace(s, vbLf & vbLf, vbLf)
Loop
cell.Value = WorksheetFunction.Trim(s)
Next cell
End Sub
Related Links
See more extensive details and instructions in the community post Rendering HTML in Exported Lists.
Documentation pages: List export.