Triggering an event upon deletion of a shape

daverico

New Member
Joined
Apr 3, 2013
Messages
4
Hi,

Looking for some help and can't seem to find anything relavent yet in searches. I need to be able to trigger an event when a shape has been deleted from a specific worksheet. To explain, I have a model that uses basic shapes for process flows and I store information inserted in those boxes in other worksheets so that I can run other analyses. However, if a user deletes a shape, I also need to delete the corresponding data in those other worksheets... I can ask the user to click a button every now and then to align the process flow with the underlying data but I'd rather automatically do this on the fly.

Anyone who can help? Ideally, Excel would have the "BeforeShapeDelete" that Visio has...

Thanks in advance!

Dave
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Hi,

Such an event per say does not exist ...

However, is the deletion of the object part of a process ?

If yes, why and when should the shape be deleted can lead to the solution ...

HTH
 
Upvote 0
Hi,

Such an event per say does not exist ...

However, is the deletion of the object part of a process ?

If yes, why and when should the shape be deleted can lead to the solution ...

HTH

It's not really part of a process to delete the shape. The shapes comprise a process flow that the user builds using some other macros I have put together. It is just that they will likely need to remove process steps (delete the shapes) as they go for whatever reason. It is a way to visually capture data used for a process simulation. Is there no way to recognize in VBA when a shape has been deleted? Maybe I can check every now and then to perform a cleanup action but it just seems a bit dirty...
 
Upvote 0
I have a button now that asks users to 'click here if you have deleted a shape' - it does the job but if anyone has a more elegant solution, please let me know. Thanks for your help James
 
Upvote 0
Hi again,

With your explanation about the process flow built by the user, I am wondering if, for the sake of building the process flow, you are keeping track of all the shapes (and their names) in some kind of a list ...
If is the case, you could have a verification against this list ...

HTH
 
Upvote 0
Good suggestion James, thanks. I have it working now, it is just triggering the cleanup that I was struggling with but I think I have a decent solution without the button - the cleanup action can be triggered when the user goes to run the simulation. Not sure why I didn't think of this before - simple is good.

Again, thanks for your help
 
Upvote 0
Glad you could fix your problem

Thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,203,071
Messages
6,053,375
Members
444,658
Latest member
lhollingsworth

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top