Author Topic: Problem with Shape.CellExists  (Read 871 times)

0 Members and 1 Guest are viewing this topic.

asfadel

  • Newbie
  • *
  • Posts: 7
Problem with Shape.CellExists
« on: July 31, 2020, 08:16:12 AM »
Hello !
I'm trying to check name of user created cell of subshapes in a group, but Shape.CellExists method always return False. Here a code:

For Each vsoShape In shp.Shapes
           If vsoShape.CellExists("Prop.type", visExistsLocally) Then
                If vsoShape.Cells("Prop.type").ResultStr("") = "Device_name" Then
                    device = vsoShape.Text
                ElseIf vsoShape.Cells("Prop.type").ResultStr("") = "ID" Then
                    device_ID = vsoShape.Text
                End If
            End If
Next
 
Howether, if I'm typing for example:
           If vsoShape.CellExists("Width", visExistsLocally)
I can get this data from this user cells. What could be the problem ? How to resolve it ?

Nikolay

  • Hero Member
  • *****
  • Posts: 951
    • UnmanagedVisio
Re: Problem with Shape.CellExists
« Reply #1 on: July 31, 2020, 09:05:10 AM »
Maybe the problem is the cell name? I.e. "type" may be cell label (text you see in the user interface), not the name.
To get the name, use shapesheet (first column) or use developer mode, then it's displayed in the UI.

If you created the property using link to data wziard then most probably the name is "_VisDM_type" and you should use "prop._VisDM_type"


JohnGoldsmith

  • Sr. Member
  • ****
  • Posts: 349
    • John Goldsmith's visLog
Re: Problem with Shape.CellExists
« Reply #2 on: August 01, 2020, 01:44:11 AM »
A couple of other things to check:


  • Are you sure the Shape Data exists at that level of the shape (ie not in a parent shape and not in a sub-shape of those sub-shapes?
  • Are you sure the Shape Data row is local? Does visExistsAnywhere produce different results?
John Goldsmith - Visio MVP
http://visualsignals.typepad.co.uk/

asfadel

  • Newbie
  • *
  • Posts: 7
Re: Problem with Shape.CellExists
« Reply #3 on: August 01, 2020, 04:16:04 AM »
Thank you for quick response, Nikolay and John ! I checked this moments, and found a problem. It was in visExistsLocally. As soon as I changed visExistsLocally to visExistsAnywhere the macro started working as it should.