Workbook 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

jmoffat

You could try selecting an other portion of the sheet

eg

sheets(1).select
range("a1").select

this will ensure that no graph is selected and you can close th
workbook as per the rest of your code
 

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