ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Workbook Deactivate (https://www.excelbanter.com/excel-programming/309875-workbook-deactivate.html)

incjourn[_4_]

Workbook Deactivate
 
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

--
Message posted from http://www.ExcelForum.com


jmoffat[_9_]

Workbook Deactivate
 
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

--
Message posted from http://www.ExcelForum.com



All times are GMT +1. The time now is 01:45 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com