How to Strip out the HTML information within my Excel Report generated from ALM?
Question ID: 105192
1
0

Hello,
How can I strip out the HTML code that shows up within the Excel reports that we have generated within ALM? The html appears in some of the sections and we would not like it to be within the reports that are generated. Any help would be appreciated.

Marked as spam
Posted by (Questions: 379, Answers: 35)
Asked on December 19, 2013 6:03 pm
120 views
Answers (2)
2
Private answer

Hello,
You can add the following code (some code gleaned from google searches) to the post processing tab within your Excel report and it should strip out all of the unwanted html tags:

Sub QC_PostProcessing()
Dim MainWorksheet As Worksheet
' Make sure your worksheet name matches!
Set MainWorksheet = ActiveWorkbook.Worksheets(''Query1'')
Dim DataRange As Range
Set DataRange = MainWorksheet.UsedRange
' Now that you have the data in DataRange you can process it.

Dim r As Range
Set r = Cells.Find(''*'', SearchOrder:=xlByRows, SearchDirection:=xlPrevious)
If Not r Is Nothing Then
Range(Cells(1, 1), r).Select
End If

Selection.NumberFormat = ''@'' 'set cells to text numberformat
With CreateObject(''vbscript.regexp'')
.Pattern = ''<.*?>''
.Global = True
For Each r In Selection
r.Value = .Replace(r.Value, '''')
Next r
End With
End Sub

Hope this helps,
Dan

Marked as spam
Posted by (Questions: 0, Answers: 770)
Answered on December 19, 2013 6:05 pm
0
Thanks. That works like a charm.
( at December 19, 2013 6:06 pm)
0
Private answer

Hi,
This will help me also.
But I have another question related to this subject.
When I do an excel report on the requirements of a project, HTML code appear in the description of some requirements and no HTML code at all for some other requirements (all requirements have bold caracters or colors or so in their description).
Do you know where do this come from?

Thank you for your help,
Freddy
,Hi,
This will help me also.
But I have another question related to this subject.

Marked as spam
Posted by (Questions: 0, Answers: 1)
Answered on December 30, 2013 4:15 pm
EyeOnTesting

Welcome back to "EyeOnTesting" brought to you by Orasi Software, Inc.

X
Scroll to Top