VISIO from Excel VBA

Joined
May 1, 2009
Messages
1
Reaction score
0
Hello,

I am trying to build a chart in VISIO from Excel VBA.

For starter I have the following code whcih does not work. I think I used the proper references.

Please advise

Thank you

Sub DrawThreeRectangles()

Dim rect1 As Visio.Shape
Dim rect2 As Visio.Shape
Dim rect3 As Visio.Shape


Set rect1 = ActivePage.DrawRectangle(0, 0, 1, 1)
Set rect2 = ActivePage.DrawRectangle(2, 2, 3, 3)
Set rect3 = ActivePage.DrawRectangle(4, 4, 5, 5)

rect1.Text = "First"
rect2.Text = "Second"
rect3.Text = "Third"

End Sub
 

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