Visio 2007: Probably not a bug, but it is confusing me none the less....
Steps:
Create an embeded excel sheet using Insert/Object Mcrosoft Office Excel Binary Worksheet and check the "display as Icon" checkbox (Also, the behavior manifests with Macro-Enabled Worksheet. I have not tried others.) For sake of example say that this object has the name of Sheet.1
Create a box with the Box tool
Group the Box and the spreadsheet object.
I would like to assign the double-click behaviour of this group to be opening up the spreadsheet for editing. So in Format/Behavior I assign a macro in the double-click tab:
This works.....
Sub EditSheet()
Dim shpTheShape As Visio.Shape
Set shpTheShape = ActivePage.Shapes("Sheet.1")
ActiveWindow.Select shpTheShape, visSubSelect
On Error Resume Next
Application.DoCmd visCmdEditOpenObject
Application.DoCmd visCmdEditOpenObject
End Sub
But why does this only work if my spreadsheet subshape is already selected when I double-click the group?
Sub EditVolumeSheet()
Dim shpTheShape As Visio.Shape
Set shpTheShape = ActivePage.Shapes("Sheet.1")
ActiveWindow.Select shpTheShape, visSubSelect
Application.DoCmd visCmdEditOpenObject
End Sub
--
Guy