Shape.OnAction stops working after workbook closed and re-opened

A

Andrew

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
 
P

Peter T

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top