ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Window change event? (https://www.excelbanter.com/excel-programming/417897-window-change-event.html)

Kevin

Window change event?
 
Is there such thing as a window change event?

I have code that resides in an add-in and I would like to have a macro in
there that would run whenever another open workbook is selected via windows
drop down or alt/tab??

Dave Peterson

Window change event?
 
If you go into the VBE and click on the ThisWorkbook item in the project
explorer, you can use the dropdowns at the top of the righthand side window.

You can choose "Workbook" in the lefthand side dropdown and then choose either
Workbook_WindowActivate or Workbook_WindowDeactivate.


Kevin wrote:

Is there such thing as a window change event?

I have code that resides in an add-in and I would like to have a macro in
there that would run whenever another open workbook is selected via windows
drop down or alt/tab??


--

Dave Peterson

Kevin

Window change event?
 
Thanks, I think I can make that work... I have an add in that all of my code
resides in and it opens different spreadsheets for each location. I wanted to
have something to keep people from selecting workbooks not having to do with
these particular spreadsheets while any of them are still open.

I'll have the windows_deactivate call a macro to check wether or not the
activeworkbook is part of the project or not...

Thanks again...

"Dave Peterson" wrote:

If you go into the VBE and click on the ThisWorkbook item in the project
explorer, you can use the dropdowns at the top of the righthand side window.

You can choose "Workbook" in the lefthand side dropdown and then choose either
Workbook_WindowActivate or Workbook_WindowDeactivate.


Kevin wrote:

Is there such thing as a window change event?

I have code that resides in an add-in and I would like to have a macro in
there that would run whenever another open workbook is selected via windows
drop down or alt/tab??


--

Dave Peterson



All times are GMT +1. The time now is 05:43 PM.

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