VBA Counting Shapes in Visio -
i want count how many shapes of 1 type have on sheet , save label.
sub counter() dim shp visio.shape dim integer each shp in activepage.shapes if shp.master.name "dv-ed.*" = + 1 end if activepage.shapes("sheeted").characters.text = cstr(i) next shp end sub
problem is, after last shape of type error
"run time error '91' : object variable or block not set"
im not familiar vba
before accessing properties name
of object, make sure object set:
sub counter() dim shp visio.shape dim integer each shp in activepage.shapes if shp.master<>nothing if shp.master.name "dv-ed.*" = + 1 end if activepage.shapes("sheeted").characters.text = cstr(i) end if next shp end sub
Comments
Post a Comment