M
Morton
I'm using Visio 2003 and trying to create a shape with
automation. Either one of these alternatives would be
fine but they both fail. Does anyone have any idea why?
I can create the Action Rows manually so that's not the
issue. Here is the code:
Sub Macro2()
Dim sh As Visio.Shape
ActiveWindow.DeselectAll
Set sh = ActivePage.DrawRectangle(4, 4, 6, 4.5)
With sh
.AddSection visSectionAction
'
' Alternative A - fails with Cannot Create
Object
'
.AddRow visSectionAction, 1, 0
.CellsSRC(visSectionAction, 1,
visActionMenu).FormulaU = "Choose Domain" ' fails here
.CellsSRC(visSectionAction, 1,
visActionAction).FormulaU = "CALLTHIS
(""ChangeProcessDomain"",)"
'
' Alternative B - fails with #NAME?
'
.AddNamedRow visSectionAction, "ChooseDomain", 0
.CellsU("Actions.ChooseDomain.Menu").FormulaU
= "Choose Domain" ' fails here
.CellsU("Actions.ChooseDomain.Menu").FormulaU
= "CALLTHIS(""ChangeProcessDomain"",)"
End With
End Sub
automation. Either one of these alternatives would be
fine but they both fail. Does anyone have any idea why?
I can create the Action Rows manually so that's not the
issue. Here is the code:
Sub Macro2()
Dim sh As Visio.Shape
ActiveWindow.DeselectAll
Set sh = ActivePage.DrawRectangle(4, 4, 6, 4.5)
With sh
.AddSection visSectionAction
'
' Alternative A - fails with Cannot Create
Object
'
.AddRow visSectionAction, 1, 0
.CellsSRC(visSectionAction, 1,
visActionMenu).FormulaU = "Choose Domain" ' fails here
.CellsSRC(visSectionAction, 1,
visActionAction).FormulaU = "CALLTHIS
(""ChangeProcessDomain"",)"
'
' Alternative B - fails with #NAME?
'
.AddNamedRow visSectionAction, "ChooseDomain", 0
.CellsU("Actions.ChooseDomain.Menu").FormulaU
= "Choose Domain" ' fails here
.CellsU("Actions.ChooseDomain.Menu").FormulaU
= "CALLTHIS(""ChangeProcessDomain"",)"
End With
End Sub