Author Topic: Strange issue with embedded excel sheet in a group  (Read 6586 times)

0 Members and 1 Guest are viewing this topic.

grtyvr

  • Newbie
  • *
  • Posts: 5
Strange issue with embedded excel sheet in a group
« on: May 06, 2014, 11:43:28 AM »
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.....
Code
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?
Code
Sub EditVolumeSheet()
    Dim shpTheShape As Visio.Shape
    Set shpTheShape = ActivePage.Shapes("Sheet.1")
    ActiveWindow.Select shpTheShape, visSubSelect
    Application.DoCmd visCmdEditOpenObject
End Sub

--
Guy

grtyvr

  • Newbie
  • *
  • Posts: 5
Re: Strange issue with embedded excel sheet in a group
« Reply #1 on: May 06, 2014, 01:41:41 PM »
OK.  More wierdness, but probably explainable.....

Insert/Object Excel Spreadsheet display as an Icon

Set double-click to OLE Verb "Edit"

First double-click on the icon throws, "An error (1415) occured during the action Open Object.  Visio unable to edit the Binary Worksheet object.

But the next double-click on the icon works.
And the next double-click fails with the same error as above.
The next double-click works
etc.

Is that how it is supposed to go?

--
Guy