VBA Classes - The Definitive Guide

  Рет қаралды 36,887

Data Ben

Data Ben

Күн бұрын

Пікірлер: 39
@Uncle_Theodor
@Uncle_Theodor 3 жыл бұрын
Thank you from Ukraine. I searched for this in the Russian-language KZbin segment, but unfortunately I couldn't find anything suitable there. Found in this video. Quite a simple and handy explanation for the topic I'm looking for.
@angeladrovermartinez2135
@angeladrovermartinez2135 3 жыл бұрын
Hey Ben, great job. It approches the topic conceptually with a very useful template. Thanks to people like you!
@databen7194
@databen7194 3 жыл бұрын
Thank you!
@seamushand8439
@seamushand8439 3 жыл бұрын
Good explanation - i especially liked the walk through of the creation of the cat object from the cat class showing the constructor etc.
@databen7194
@databen7194 3 жыл бұрын
Thanks Seamus :)
@shiva11112
@shiva11112 3 жыл бұрын
Excellent knowledge and presentation, is this possible to apply inheritance of classes from other classes (not interfaces) in VBA
@LuisBreak
@LuisBreak 5 ай бұрын
Great tutorial. Very helpful. Thanks!!! I was wondering two things. 1. Should we avoid On Error Resume next since it is not a good practice and instead having a common method called Animal.Sound() that will be implemented by each Specific Animal? 2. Should the variable animal be declared as Animal Type instead of Variant? Is that possible? In other languages that would be more appropriated, since Variant would accept Any type and that would cause an error in the code for sure.
@aNDy-qh1em
@aNDy-qh1em 3 жыл бұрын
Hi, thanks, very detailed explanation! 'On Error Resume Next' seems to be not nice practice as in the runtime there could be other error passing by which should not be disregarded. IMHO it would be nicer to have 'Sound' method inside Animal interface that would bark for the dog and meou for a cat instance.
@SimpleExcelVBA
@SimpleExcelVBA 3 жыл бұрын
Really good example for interfaces and classes use. This could be also in shorter version for not as patient people as me :D Anyway, good effort!
@julianevans2256
@julianevans2256 2 жыл бұрын
Excellent tutorial, very well explained
@ukBenuk
@ukBenuk 2 жыл бұрын
Thanks Julian :)
@chrisk.2957
@chrisk.2957 8 ай бұрын
Thank you Ben! In the Loop for the Debug.Printing (animal.Name) I get a runtime error 438 (without error handling, otherwise it stays blank). Any idea? Thanks.
@freeliberalminds
@freeliberalminds Жыл бұрын
This is hilarious and totally explained. Thank you Ben.
@databen7194
@databen7194 Жыл бұрын
Thanks!
@orange1826
@orange1826 3 жыл бұрын
Very clear video, thanks. Do you do any work with Access?There are few videos on class modules and Access. I realize that your samples use vba and are not necessarily limited to excel.
@databen7194
@databen7194 3 жыл бұрын
Sorry I no longer develop in Access. You are right; this video transfers 100% across to Access as well. Access VBA has it's own set of Access objects and it will be harder to visualise the objects in a database compared to a worksheet, so I recommend learning in Excel first.
@joukenienhuis6888
@joukenienhuis6888 Жыл бұрын
Great explanation of object oriented coding. I only don’t see the use with Excel in this example, only just to get to the vba screen.
@hosseinmolhem3118
@hosseinmolhem3118 9 ай бұрын
Dear Ben, Thanks for sharing knowledge. let me know how can access to your code?
@lorenzogaruglieri7046
@lorenzogaruglieri7046 2 жыл бұрын
hi, the video is really exhaustive. A question if possible: I am trying to use, almost like in your example, a property which is a collection, but which is not private but is also present in the interface. I am only getting errors such as "invalid argument". It is possible to implement a collection in an object that implements an interface. Thanks in advance. Lorenzo
@bigt95nt011037
@bigt95nt011037 2 жыл бұрын
I don't suppose there examples of the lecture that can be downloaded?
@userme2803
@userme2803 3 жыл бұрын
can you tell me why I need to learn Object oriented concept before or as a prerequisite to learn VBA? Can you give me an example from real life as an analogy so I can understand it better? Thank you
@databen7194
@databen7194 3 жыл бұрын
Hi Userme, VBA is built upon OOP principles like many other programming languages, so once you understand OOP, you understand the fundamentals of VBA and how you interact with it will be clearer. For a great answer on VBA and OOP principles see: stackoverflow.com/a/31861832/15011558
@thearchibaldtuttle
@thearchibaldtuttle 3 жыл бұрын
Nice, thank you!
@alexlev8815
@alexlev8815 3 жыл бұрын
Hi, Ben! Why do we need to use Get-Let-Set statements to add properties to class if we can just use Public variables in classes?
@databen7194
@databen7194 2 жыл бұрын
Hi Alex, well you may want to do much more instead of just setting a public variable. I kept the examples in the video simple, but there's nothing stopping you expanding on them: For example in Let you could do some checks first, maybe an if statement to check the name of the animal does not exceed 30 characters, or do a check that the cats age is not over 100 years old. Your Let checks can go on for as long you like! For the get, you may want to do a calculation first, for example instead of just saying 'meow' you could randomise the result with some extra code so the cat says 'meow', 'purrr', 'hiss' and so on to add some variety. Again impossible with a simple public data type. You can expand your set-get-let's as much as you like and get as interesting as you want, while the public variables are simple data types only: strings, integers and so on. I hope these examples help, good luck!
@alexlev8815
@alexlev8815 2 жыл бұрын
@@databen7194 Thank you! Now it became much more clear to me.
@marekchudy8893
@marekchudy8893 Жыл бұрын
Thank you.
@amorbatna2725
@amorbatna2725 Жыл бұрын
يعطيك الصحة بارك الله فيك
@henrikijonkoping4694
@henrikijonkoping4694 3 жыл бұрын
Good Ben, what is the name of the next video to this? This was very intersting
@thearchibaldtuttle
@thearchibaldtuttle 3 жыл бұрын
Could it be this one? kzbin.info/www/bejne/qIucZ52IlN5nnbs&ab_channel=DataBen
@henrikijonkoping4694
@henrikijonkoping4694 3 жыл бұрын
@@thearchibaldtuttle Thank you, i will check it out
@marekchudy8893
@marekchudy8893 3 жыл бұрын
Thank you. :-)
@عليعلي-ن1خ3ص
@عليعلي-ن1خ3ص 8 ай бұрын
I don't see you using the Animal interface!
@engrvarsi3774
@engrvarsi3774 3 жыл бұрын
Thanks
@databen7194
@databen7194 3 жыл бұрын
You're welcome!
@hichamhadj9640
@hichamhadj9640 7 ай бұрын
Excellent toturial, I only wish the examples were more practical like contacts, orders, forms... Etc, instead of cats and dogs. Don't get me wrong, I love cats 😂
@LokeshKumar-yi3ln
@LokeshKumar-yi3ln 3 жыл бұрын
Could you please share the code..
@kimfucku8074
@kimfucku8074 3 жыл бұрын
Check his next video, the download link is in the description kzbin.info/www/bejne/qIucZ52IlN5nnbs&ab_channel=DataBen
@Stache987
@Stache987 2 жыл бұрын
Just wait till you own pets, one cat of four here doesn't like toys, just pet treats and doesn't give up the cheek rubs until you give him enough, he almost never meows, at first I thought he was mute, then one day at the back door he did. Another is a theif, you'll wake up to a roll of toilet paper all unrolled and in fragments of pieces, so you have to hide it in cabinets, as for cabinets we had to put child locks on the cabinet under the kitchen sink, they learned how to open it, and there's chemicals that could harm them. One is so stupid he likes his little pot pom balls and likes to play catch. The last cat won't let daddy out of his sight, and is usually against him. As for dogs, I've had two that were so faithful they lived a fu natural life, you could shake the keys and say ride and they will beat you to the car. I've only had one dog learn how to get out of the kennel, he loved to run, and a anonymous neighbor hit him and brought him home for a burial. I tried living without a pet, even worked weekly at a shelter just to love on them. Sorry for rant.. but the discussion just brought it on.
VBA Project - Pet Shelter (CLASSES and OBJECTS)
26:26
Data Ben
Рет қаралды 6 М.
10 Years of VBA Array Knowledge in 40 Mins
41:57
Excel Macro Mastery
Рет қаралды 22 М.
这是自救的好办法 #路飞#海贼王
00:43
路飞与唐舞桐
Рет қаралды 116 МЛН
ЗНАЛИ? ТОЛЬКО ОАЭ 🤫
00:13
Сам себе сушист
Рет қаралды 4,1 МЛН
🕊️Valera🕊️
00:34
DO$HIK
Рет қаралды 20 МЛН
Working with Multiple Classes in VBA
1:11:47
Jennifer Garth
Рет қаралды 6 М.
How to Use Class Interfaces in Excel VBA
20:16
Excel Macro Mastery
Рет қаралды 81 М.
VBA Classes
40:43
Siddharth Rout
Рет қаралды 9 М.
VBA (Использование классов и объектов) ч.1
22:03
Ruslan Scherbakov - kursoft ru
Рет қаралды 21 М.
Creating Classes in VBA
10:19
Jennifer Garth
Рет қаралды 19 М.
The Only Unbreakable Law
53:25
Molly Rocket
Рет қаралды 336 М.
Convert Existing VBA Code into a Class
25:55
Jennifer Garth
Рет қаралды 9 М.
Excel VBA Arrays - A Complete Guide
1:21:51
Excel Macro Mastery
Рет қаралды 73 М.
这是自救的好办法 #路飞#海贼王
00:43
路飞与唐舞桐
Рет қаралды 116 МЛН