I have a BO report with some cells. I want to delete them through VBA.
So I study the report (sections, body…), and when I find cells I want, I use the function delete.
But it deletes only what the cell contains (for example an image). The cell is still visible after that (when I click in the report, I see the cell in black).
How can I do to remove completely the cell? Is it possible?
I think I found my problem, but I need some help :
I want to delete all cells which are associated with a DocumentVariable and have a specific name too.
So I write something like :
...
Set Obj_ReportStructItems = obj_sectionStruct.Body
For Each Obj_ReportStructItem In Obj_ReportStructItems
If Obj_ReportStructItem.Type = boCell Then
If Obj_ReportStructItem.Variable.Name <> "" Then
If Obj_ReportStructItem.Variable.Name = s_cellMapName _
Or Obj_ReportStructItem.Variable.Name = s_cellLegendName Then
Obj_ReportStructItem.Delete
rep.ForceCompute
End If
End If
End If
Next
...
What’s wrong?
I think the problem is that I delete in the For Each …