Why code below return always "Bounding box is not empty" ?

Private Sub CommandButton23_Click()
'Sub BoundingBoxExample()
' Create a new shape (e.g., rectangle)
Dim myShape As shape
Set myShape = ActiveLayer.CreateRectangle(2, 1, 5, 5)

' Get the bounding box of the shape
'Dim myBoundingBox As ShapeRange
Set myBoundingBox = myShape.BoundingBox

' Check if the bounding box is empty
If myBoundingBox.IsEmpty Then
MsgBox "Bounding box is empty."
MsgBox "Bounding box is not empty."
End If

' Delete the shape (optional)
'End Sub

End Sub

What to do to return "Bounding box is empty."

Code is started when new file is created, with no other shapes on it


Parents Reply Children
No Data