When you import a EMF or SVG into Visio, and then ungroup everything, you will have many additional objects or shapes that are completely invisible.
This macro removes these invisible obje
Sub DeleteShapesWithNoFillNoLineNoText()
Dim shp As Visio.Shape
Dim pg As Visio.Page
Dim i As Integer
Dim removeCount As Integer
Set pg = ActivePage
' Loop backwards to avoid issues when deleting shapes
For i = pg.Shapes.Count To 1 Step -1
Set shp = pg.Shapes(i)
ActiveWindow.Select shp, visDeselectAll + visSelect
' Check if shape has no fill and no line
If shp.CellsU("FillPattern").Result("") = 0 And _
shp.CellsU("LinePattern").Result("") = 0 And _
Trim(shp.Text) = "" Then
removeCount = removeCount + 1
shp.Delete
End If
Next i
ActiveWindow.Select shp, visDeselectAll
MsgBox removeCount & " shapes with no fill and no line have been deleted.", vbInformation
End Sub