Defining VBA Classes

I apologize in advance if this is a top-down question, but I really need help understanding how to find out what to do from classes in a VBA project.

NOTE. I do not ask how to code the class. I ask how to determine what a class is for.

Example

I want to draw shapes on a PowerPoint slide. 2 out of 3 kinds of forms that I need have the same properties and methods. I would create a class called CShapeor 3 classes: CCircle, CSquare, CRectangle? In addition, lines are considered shapes in PowerPoint. Should I add a class CLineor just combine everything together in CShape?

I searched Google for class definition methodologies in VBA and the like, but found nothing. Does anyone have a method or a way in which they determine how to create classes for their projects (and the reasons for this)?

In addition, I just go into classes and interfaces, and this is the first project in which I use them. Thank!

UPDATE

I found this: When to use a class in VBA?

+4
source share
3 answers

When you work with code that can be reused, this is the perfect time to use classes.

, . , , . PowerPoint , - , - .

Chip Pearson, , .

http://www.cpearson.com/Downloads/Downloads.aspx

, .

+2

VBA ( , Visual Basic 6) .

, , , , , , IDrawable. , , .

IDrawable , , , .

, . , , .

. , ?

+1

VBA 20 .
, ( , ), . .MoveNext , .EoF, .Price, .Rate, , , , , .

0

Source: https://habr.com/ru/post/1690014/


All Articles