Deactivate

  • Thread starter Thread starter incjourn
  • Start date Start date
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
 
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/
_______
 
Back
Top