From the course: Excel VBA: Process Modeling

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Create an instance of a class

Create an instance of a class

From the course: Excel VBA: Process Modeling

Start my 1-month free trial

Create an instance of a class

- [Instructor] After you define a class and its properties, you can create an object that is a member of that class. In object-oriented programming, an example of a class is called an instance. For example, if you are simulating the movement of customers through a sandwich shop, you would create instances of the shop stations as well as instances for each customer that visits the shop. After you create the instance, you can assign values to properties. In this movie, I will show you how to create an instance of a class using VBA. My sample file is chapter 0103, and that's a macro-enabled workbook you can find in the chapter one folder of the exercise files collection. We'll be working exclusively in VBA, so I will go ahead and press Alt + F11 to move to the Visual Basic Editor. I have left open the customer class module and you can see that I have the variables I defined here at the top and also I have created Get and…

Contents