Deactivate

I

incjourn

I am using the following code in ThisWorkbook:

Private Sub Workbook_Deactivate()
MsgBox "Deactivating Workbook"
End Sub

This works fine in most cases. However, if I have selected an imbedde
chart on a worksheet, I find the macro doesn't run.

Can anyone help
 
J

Jon Peltier

The embedded chart is part of a worksheet in the workbook, so activating
it does not deactivate the sheet or the workbook. You could either
assign a macro to the shape that contains the chart (right click on the
chart and choose Assign Macro), or you could use a class module to
capture chart events, which include Activate.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______
 

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