![]() *Inheritance is using an existing class to build a new class. Let’s start this post by looking at why we use objects in the first place. The purpose of VBA Class Modules is to allow us to custom build our own objects. In VBA we have built-in objects such as the Collection, Workbook, Worksheet and so on. In VBA, Inheritance works in a similar way to Interfaces** in C#\Java. The major difference is that VBA Class Modules have a very limited type of Inheritance* compared to classes in the other languages. Class Modules are the VBA equivalent of these classes. In languages such as C# and Java, classes are used to create objects. If you are not familiar with objects then I would highly recommend that you first check out my previous post VBA Objects – The Ultimate Guide. ![]() VBA Class Modules allow the user to create their own objects. ( Note: Archive members have access to the webinar archive.) Members of the Webinar Archives can access the webinar for this article by clicking on the image below. Sub that automatically runs when the class module object is deleted. ![]() Sub that automatically runs when the class module object is created. Special function/subs that behave like variables when used 10.3.3 Using a Property instead of a Function/SubĪ Quick Guide to the VBA Class Module ItemĪllows the user to create their own objects.Ī public function or sub in the class module. ![]()
0 Comments
Leave a Reply. |