S
Simon P
I have a VBA macro in Visio 2003 Professional which gives a runtime error
when assigning the EventDblClick cell formula for the selected shape. I've
included the relevant code below. Interestingly if the shape sheet for the
current selection is opened and the CALLTHIS string is manually entered into
the EventDblClick formula, tha value is accepted without an error and the
double click behaviour subsequently works as I had hoped - ie calling the
showEntryMapShapeProperties method.
Does anyone know why the macro should fail on this line. Are there any
security settings which might prevent the assignment of cell formulas in
macro whilst allowing them to be done manually via the shape sheet.
Many thanks in advance
---------------------------
Public Sub makeEntryMapShape()
Dim sh As Shape
Dim conn As Shape
Dim x As Double, y As Double
For Each sh In ActiveWindow.Selection
With sh
.Cells("EventDblClick").Formula =
"=CALLTHIS(""ThisDocument.showEntryMapShapeProperties"",""entrymap"")"
End With
Next sh
End Sub
Private Sub showEntryMapShapeProperties(sh As Shape)
....
when assigning the EventDblClick cell formula for the selected shape. I've
included the relevant code below. Interestingly if the shape sheet for the
current selection is opened and the CALLTHIS string is manually entered into
the EventDblClick formula, tha value is accepted without an error and the
double click behaviour subsequently works as I had hoped - ie calling the
showEntryMapShapeProperties method.
Does anyone know why the macro should fail on this line. Are there any
security settings which might prevent the assignment of cell formulas in
macro whilst allowing them to be done manually via the shape sheet.
Many thanks in advance
---------------------------
Public Sub makeEntryMapShape()
Dim sh As Shape
Dim conn As Shape
Dim x As Double, y As Double
For Each sh In ActiveWindow.Selection
With sh
.Cells("EventDblClick").Formula =
"=CALLTHIS(""ThisDocument.showEntryMapShapeProperties"",""entrymap"")"
End With
Next sh
End Sub
Private Sub showEntryMapShapeProperties(sh As Shape)
....