From the course: Excel: Learning VBA

Unlock the full course today

Join today to access over 23,200 courses taught by industry experts.

Run a procedure when you open, close, or save a workbook

Run a procedure when you open, close, or save a workbook - Microsoft Excel Tutorial

From the course: Excel: Learning VBA

Run a procedure when you open, close, or save a workbook

- [Instructor] When you create a business solution using Excel macros, you gain the ability to influence your user's actions. For example, you can display a welcome message when a workbook opens, verify a workbook's integrity before it's closed, and examine contents before a workbook is saved. Each of these event handling routines helps to ensure your workbook will function the way you want it to. In this movie, I will show you how to create events for several different scenarios, when you open, close, or save a workbook. I don't have any files open yet, but what I will do is in the Chapter Seven folder of the Exercise Files collection, double click 0701, Manage Events. So I'll double click there to open it. Excel starts. And you can see that a macro ran right when the workbook opened. And it says "Welcome to the commission tracking workbook." To close the message box, I'll click OK. So the question is, how did that…

Contents