Если ни CellExists, ни CellExistsU не вернут совпадение, это будет означать, что фигура, на которую вы указываете, не имеет строки данных формы с таким именем.Если это так, то вам может пригодиться перебрать все фигуры на странице и проверить, что в них содержится.Вот небольшой фрагмент кода, который поможет с этим:
Public Sub ReportPageShapes()
Dim vPag As Visio.Page
Set vPag = ActivePage
Dim shp As Visio.Shape
For Each shp In vPag.Shapes
ReportShapeData shp, 0
Next
End Sub
Private Sub ReportShapeData(ByRef shp As Visio.Shape, indent As Integer)
Dim iPropSect As Integer
iPropSect = Visio.VisSectionIndices.visSectionProp
Debug.Print String(indent, Chr(9)) & shp.NameID & " (Index = " & shp.Index & ")"
If shp.SectionExists(iPropSect, Visio.VisExistsFlags.visExistsAnywhere) <> 0 Then
Dim i As Integer
For i = 0 To shp.Section(iPropSect).Count - 1 Step 1
Dim vCell As Visio.Cell
Set vCell = shp.CellsSRC(iPropSect, i, Visio.VisCellIndices.visCustPropsValue)
'Could also report vCell.RowName here as well if required
Debug.Print String(indent, Chr(9)) & Chr(9) & vCell.RowNameU, vCell.ResultStr("")
Next i
End If
If shp.Shapes.Count > 0 Then
Dim s As Visio.Shape
For Each s In shp.Shapes
ReportShapeData s, indent + 1
Next
End If
If indent = 0 Then
Debug.Print vbCrLf
End If
End Sub
Это циклически перебирает каждую фигуру на странице + все дочерние фигуры (так как они могут содержать данные формы), возвращая или вызывая один и тот же метод для каждогоребенок.