Hi,
I'm quite new to Visio VBA and have a problem that is so simple - I can't find the answer. The following code gives a compilation error "Type mismatch" in marked line:
Private Sub MakeShapeRed(myShp As Visio.Shape)
' Just do something magical with this shape
End Sub
Private Sub MakeAllShapesRed(myShape As Visio.Shape)
Dim myGroupShape As Visio.Shape
MakeShapeRed (myShape) ' Do some magic to this shape, but this gives a TYPE MISMATCH
For Each myGroupShape In myShape.Shapes
MakeAllShapesRed (myGroupShape) ' and recursive for groups
Next myGroupShape
End Sub
Can anybody open my eyes, please?
remove the brackets from the parameters of subs.
functions require them, subs only work without.
haven't understood the philosophy behind this convention, but that's how it works.
Thanks. It was so obvious - and the error message was so erroneous. Problem solved.