Hey guys, welcome back. So in this video we're going to speak about the workbook activate event. So the workbook activate event works whenever you activate your workbook. However, it does not work when you activate your workbook coming from another application other than Excel, but it actually works when you activate your workbook coming from another workbook in Excel. Okay, so let's see that in action. So I'm going to go to the developer tab on the ribbon, click on Visual Basic, and I'm going to double click here on this workbook to open the module for workbook events.
And then I'm going to select workbook from this menu, I'm going to select the Activate event. So now I've selected the Activate event. And I'm just going to write a simple message box here message box. Maybe when you select it back, you would say welcome back. Okay, a simple message box. Now I'm just going to close here, the VBA editor and now I'm gonna switch to Microsoft Word so I'm now I'm on Microsoft Word.
If I switch back to excel, you see nothing happens, okay? However, if I open a new workbook and I switch to my workbook, the event gets fired or whatever code you've written there, gets executed. Okay? So this is how the workbook activate event works. Remember, it does not work when you activate the workbook coming from another application. It works when you activate the workbook coming from another workbook in Excel.
Okay, so you can pretty much make any code run whenever you activate your workbook. Okay, so that's it for the workbook activate event is very simple. I don't use it a lot, but probably you could have other uses your story could be different. Okay? So feel free to open to discussion on what you might use it in or how you use it or what It was useful for in your cases. Okay.
So thanks very much for watching this video. I'll see you on the next one.