J
Josef Meile
Hi,
I inserted a Microsoft Office Excel Object on a Visio 2003 drawing. Then I
fill it with some data. Finally I would like to call a macro that locates and
highligths an specified row. The steps I need to do are the following:
1) Select the Ole Object. This wasn't a big problem, I did:
ActiveWindow.DeselectAll
ActiveWindow.Select Application.ActiveWindow.Page.Shapes.ItemFromID(1),
visSelect
and worked fine.
2) Enter programatically into the Ole Object instead of having to double
click on it. I didn't succeeded here, see the last part of the message to see
what I have tried.
3) Selecting the desired row: For now I will give a number to the row, but
later, this will be done with any number:
ActiveWindow.Selection(1).Object.Sheets(1).Rows("7:7").Select
The last step should theorically work. I don't know it yet because I fail
doing the previous step: Entering in to the ole object.
On the second step I tried several things:
a) recorded a macro while doing double click on the worksheet object.
Unfortunately, an empty macro was recorded.
b) started the Visio Event Monitor from the SDK add-ins and tried to guess
where the following events are called:
10805 SelectionChanged window[1] Drawing1.vsd Page-1 subtype is 128
[/hwnd=4981414]
10823 SelectionChanged window[1] Drawing1.vsd Page-1 subtype is 128
[/hwnd=4981414]
10824 >EnterScope Open Object [1029;0;Open Object]
From there I understood that the first two events happen whenever I double
click on the mentioned object -> An SelectionChanged event pro click. Then,
an "Open Object" event happens when entering to the ole Object, but the
question is: where is this "Open" method? I tried several alternatives
without any success.
Then I tried the following things:
c) ActiveWindow.Selection(1).Object.Sheets(1).Activate -> didn't work
d) ActiveWindow.Selection(1).Object.Application.Visible = True -> didn't work
e) On the newsgroups, I found that from visual basic or excel, there is
something called "OLE Container" and you can use:
yourOLEContainer.DoVerb (-5) -> Where -5 means "in-place activation"
acording to the poster of this solution.
Translating it to visio, I think it would be something like:
ActiveWindow.Selection(1).DoVerb (-5)
but it complains and says that there isn't such method.
Does any body has a solution to this problem?
Thanks in advanced,
Josef Meile
I inserted a Microsoft Office Excel Object on a Visio 2003 drawing. Then I
fill it with some data. Finally I would like to call a macro that locates and
highligths an specified row. The steps I need to do are the following:
1) Select the Ole Object. This wasn't a big problem, I did:
ActiveWindow.DeselectAll
ActiveWindow.Select Application.ActiveWindow.Page.Shapes.ItemFromID(1),
visSelect
and worked fine.
2) Enter programatically into the Ole Object instead of having to double
click on it. I didn't succeeded here, see the last part of the message to see
what I have tried.
3) Selecting the desired row: For now I will give a number to the row, but
later, this will be done with any number:
ActiveWindow.Selection(1).Object.Sheets(1).Rows("7:7").Select
The last step should theorically work. I don't know it yet because I fail
doing the previous step: Entering in to the ole object.
On the second step I tried several things:
a) recorded a macro while doing double click on the worksheet object.
Unfortunately, an empty macro was recorded.
b) started the Visio Event Monitor from the SDK add-ins and tried to guess
where the following events are called:
10805 SelectionChanged window[1] Drawing1.vsd Page-1 subtype is 128
[/hwnd=4981414]
10823 SelectionChanged window[1] Drawing1.vsd Page-1 subtype is 128
[/hwnd=4981414]
10824 >EnterScope Open Object [1029;0;Open Object]
From there I understood that the first two events happen whenever I double
click on the mentioned object -> An SelectionChanged event pro click. Then,
an "Open Object" event happens when entering to the ole Object, but the
question is: where is this "Open" method? I tried several alternatives
without any success.
Then I tried the following things:
c) ActiveWindow.Selection(1).Object.Sheets(1).Activate -> didn't work
d) ActiveWindow.Selection(1).Object.Application.Visible = True -> didn't work
e) On the newsgroups, I found that from visual basic or excel, there is
something called "OLE Container" and you can use:
yourOLEContainer.DoVerb (-5) -> Where -5 means "in-place activation"
acording to the poster of this solution.
Translating it to visio, I think it would be something like:
ActiveWindow.Selection(1).DoVerb (-5)
but it complains and says that there isn't such method.
Does any body has a solution to this problem?
Thanks in advanced,
Josef Meile