From: Andrew on
I have created a set of icons which are made up of 3-4 individual
shape objects grouped together. One of those objects needs to respond
to a mouse click which I achieve using the OnAction setting, ie.
shp.GroupItems(shp.Name).OnAction = "ShapeClick"
where the shape and the group have the same name.

Connector lines are used to join the icons up into a network.
Unfortunately in XL2007 when connecting a line to the object the click
event fires so to avoid this I first set OnAction to "" and then set
it back to my macro after connections are made.

Initially this works beautifully however after closing and re-opening
the workbook it stops working and my OnAction code line results in
"Application-defined or object-defiend error".

Does anyone have any idea why simply closing and re-opening the
workbook might be having this effect?

Thanks,
Andrew
From: Peter T on
> Initially this works beautifully however after closing and re-opening
> the workbook it stops working and my OnAction code line results in
> "Application-defined or object-defiend error".

It sounds like the OnAction is working fine and triggering the macro, but
something's going wrong with a line of code in the macro to trigger that
error.

Just for testing, make the first line of the macro "Stop" (without quotes).
Save the workbook, reopen and try again. When the macro stops, step through
it be pressing F8.

Regards,
Peter T


"Andrew" <hooksie2(a)hotmail.com> wrote in message
news:e8b5b0ba-2303-428d-abb5-d533e4ac3310(a)o11g2000yqj.googlegroups.com...
>I have created a set of icons which are made up of 3-4 individual
> shape objects grouped together. One of those objects needs to respond
> to a mouse click which I achieve using the OnAction setting, ie.
> shp.GroupItems(shp.Name).OnAction = "ShapeClick"
> where the shape and the group have the same name.
>
> Connector lines are used to join the icons up into a network.
> Unfortunately in XL2007 when connecting a line to the object the click
> event fires so to avoid this I first set OnAction to "" and then set
> it back to my macro after connections are made.
>
> Initially this works beautifully however after closing and re-opening
> the workbook it stops working and my OnAction code line results in
> "Application-defined or object-defiend error".
>
> Does anyone have any idea why simply closing and re-opening the
> workbook might be having this effect?
>
> Thanks,
> Andrew