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

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -