.RowCount .CellSRC Meethod exist?

P

plz ^^

I read http://www.mvps.org/visio/VBA.htm
Custom Property

Set shpObj = Visio.ActivePage.Shapes(ShpNo)
nRows = shpObj.RowCount(Visio.visSectionProp)
For i = 0 To nRows - 1
Set celObj = shpObj.CellsSRC(Visio.visSectionProp, i, 0)
ValName = celObj.ResultStr(Visio.visNone)

this code .RowCount and .CellsSRC Method don't exist.
wht not?
 
C

Chris [Visio MVP]

Not sure what's wrong. Try this proc:

Sub CpDump()

Dim shp As Visio.Shape
Dim c As Visio.Cell
Dim iRows As Integer

'Set shp = Visio.ActivePage.Shapes(1)
Set shp = Visio.ActiveWindow.Selection(1)

iRows = shp.RowCount(Visio.visSectionProp)
If iRows > 0 Then

For i = 0 To iRows - 1
Set c = shp.CellsSRC(Visio.visSectionProp, i, 0)
Debug.Print c.RowName, c.RowNameU, c.ResultIU,
c.ResultStr(visNoCast), c.Formula
Next

Else

Debug.Print "No custom properties"

End If

End Sub


If that doesn't work, then something other than the code is wrong.
 
P

plz ^^

At first Thank you for your reply ^^
I uesd VB.NET
So CpDump() code convert VB.NET
Dim shp As Visio.Shape
Dim c As Visio.Cell
Dim iRows As Integer
Dim i As Integer

shp = AxDrawingControl1.Window.Application.ActivePage.Shapes(1)
shp = AxDrawingControl1.Window.Application.ActiveWindow.Selection(1)

iRows = shp.RowCount(??????)
If iRows > 0 Then
For i = 0 To iRows - 1
c = shp.CellsSRC(????? , i, 0)
Next

End If

..RowCount and .CellsSRC exist..
But ????? - > Visio.visSectionProp don't exist..
hmm... what is wrong?
and How can I do?
Help me.. ^^


"
 
P

plz ^^

I am sorry.
I find.. Visio.VisSectionIndices.visSectionProp ^^

but. I dont find "visNoCast"

^^;
 
A

Al Edlund

when using the import statement at the beginning of the module the
Imports Microsoft.Office.Interop.Visio

may not be enough. Using the object browser you can discover that you may

have to add this as well

Imports Microsoft.Office.Interop.Visio.VisSectionIndices

al
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top