Thinking about diving into Object-Oriented Programming (OOP) in a future video! 📚 If you’re interested, drop a comment below and let me know! The more interest we get, the sooner I can make it happen! 👇💬 #OOP #CodingCommunity #LetMeKnow
Thank you so much! I'm glad you found the explanation clear 🙌 Your support means a lot. Stay tuned for more content like this, and feel free to drop any questions or topics you'd like me to cover! 😊
Holy moly! I’ve been scripting with VBA for years but struggled with understanding classes. This is the video I needed. This new knowledge will help me right away in a project I am working on. Thank you!
Thank you so much for your kind words! 🌟 I'm thrilled to hear that the video helped you understand VBA classes better. It's amazing to see how learning something new can immediately impact your projects. If you have any more questions or need further clarification as you dive into your current project, feel free to reach out. Keep up the fantastic work, and happy coding!
Thanks for the explanation mr. Sidd. OOP is great if you want to be a good developer (i think). I've read a lot of concepts from internet, but there are misunderstanding data. This way is great. 🤗🤗
Hi Siddharth, this is my first time on your channel and I hit the subscribe button after only two minutes. Your easy to understand explanation at the beginning of the video has already convinced me. Well done! Keep up the good work!
EXCELLENT Tutorial!!!!!!...... using real world example makes it so much easier to understand! - a couple of small requests/suggestions. Could you step through the code and explain as the program runs - it helps to understand the process flow. As you advance set breakpoints so there is not a lot of repetition. A second request/suggestion is to show how to crerate a user interface - perhaps as a follow up video? - A REALLY great job!!!...
Why do you use composition? You could have declared a variable in the standard module, such as Dim MyVariable As Gear. Then in Sub DriveCar, you can replace .TheGear.GearUp with MyVariable.GearUp. Similarly for .TheGear.GearDown with MyVariable.GearDown. How does using TheCar.TheGear.GearUp help? I think it confuses people (certianly me)! Thanks
Very good question! I used composition so that the relationship can be maintained. This way if the parent object is deleted, then the child object also loses its status. For example, if the car is destroyed then the Gear is also destroyed. If I keep it in a module separately then there is no relationship. Even when the car object is destroyed, the gear object will still be available. You don't want the gear to be dangling around after the car is destroyed. 😊
I created classes just so I can move multiple variables via a dictionary. Should I instead move the code that uses the variables into the class methods and just instantiate the class every time I need to manipulate data associated with the class?
While I can't comment without looking at your code, it is a good idea in general to move variables inside classes and expose them via properties. This is in accordance with OOP concept and is called "encapsulation". It makes for better code overall.
Hi! I’d love to dive into OOP, but I’ve been waiting for a stronger response from viewers to make sure it’s something people want. You and just a couple others have shown interest so far. If more viewers want to see it, I’d be thrilled to create this content!
@@SiddharthRout The problem is not many VBA developers would be aware that it's possible to create VBA programs in an OO way. I bet 99% of VBA developers have never heard of design patterns or SOLID principles, so obviously they won't be requesting it. However, once you've introduced it, I'm sure you'll open up more interest.
I couldn't understand how event Works in class Module, you should have created this video in multiple parts in details by telling each and every concepts line by line.. 😂 I want to learn WithEvent and Raise Event concept in details, so make a Video on these topics as well.
Thinking about diving into Object-Oriented Programming (OOP) in a future video! 📚 If you’re interested, drop a comment below and let me know! The more interest we get, the sooner I can make it happen! 👇💬 #OOP #CodingCommunity #LetMeKnow
I'm profoundly interested in the Object Oreiented Programming - OOP Series.
Kindly make it happen fast.
Cheers!!
Thank you so much for this outstanding tutorial! Great job!
So clear teaching style!
Thank you so much! I'm glad you found the explanation clear 🙌 Your support means a lot. Stay tuned for more content like this, and feel free to drop any questions or topics you'd like me to cover! 😊
Holy moly! I’ve been scripting with VBA for years but struggled with understanding classes. This is the video I needed. This new knowledge will help me right away in a project I am working on. Thank you!
Thank you so much for your kind words! 🌟 I'm thrilled to hear that the video helped you understand VBA classes better. It's amazing to see how learning something new can immediately impact your projects. If you have any more questions or need further clarification as you dive into your current project, feel free to reach out. Keep up the fantastic work, and happy coding!
Great, clear, instructive video on classes using vba. Added it to my references of recommended sample code.
Thanks for taking the time out to appreciate it.
Thanks for the explanation mr. Sidd. OOP is great if you want to be a good developer (i think). I've read a lot of concepts from internet, but there are misunderstanding data. This way is great. 🤗🤗
Thanks Jiri for taking the time out to appreciate it 😊
Хоть и не на русском но я все равно понял основу принципа работы. Самый хороший обзор. Большое спасибо брат! Успехов твоему каналу. 🤝
Рад помочь. Если у вас есть вопросы, вы можете задать их на русском языке, и я постараюсь вам ответить :)
Hi Siddharth, this is my first time on your channel and I hit the subscribe button after only two minutes. Your easy to understand explanation at the beginning of the video has already convinced me. Well done! Keep up the good work!
Thanks for taking the time out to appreciate it.
Amazing job!
Thanks for taking the time out to appreciate it. Strange, I did not get an alert for your comment.
Excellent video Sid - very instructive!
Glad you like it. And thank you for taking the time out to appreciate it. :)
Loved the way you explained. Thank you!! 😄
Keep it up!
Glad you liked it Ramandeep :)
EXCELLENT Tutorial!!!!!!...... using real world example makes it so much easier to understand! - a couple of small requests/suggestions. Could you step through the code and explain as the program runs - it helps to understand the process flow. As you advance set breakpoints so there is not a lot of repetition. A second request/suggestion is to show how to crerate a user interface - perhaps as a follow up video? - A REALLY great job!!!...
Thanks for the suggestions. Will try and incorporate them in my next video :)
Why do you use composition?
You could have declared a variable in the standard module, such as Dim MyVariable As Gear.
Then in Sub DriveCar, you can replace .TheGear.GearUp with MyVariable.GearUp.
Similarly for .TheGear.GearDown with MyVariable.GearDown.
How does using TheCar.TheGear.GearUp help? I think it confuses people (certianly me)!
Thanks
Very good question! I used composition so that the relationship can be maintained. This way if the parent object is deleted, then the child object also loses its status. For example, if the car is destroyed then the Gear is also destroyed. If I keep it in a module separately then there is no relationship. Even when the car object is destroyed, the gear object will still be available. You don't want the gear to be dangling around after the car is destroyed. 😊
@@SiddharthRout Thanks for the explanation.
Can you upload again the file ? it was deleted
Link Updated
I created classes just so I can move multiple variables via a dictionary. Should I instead move the code that uses the variables into the class methods and just instantiate the class every time I need to manipulate data associated with the class?
While I can't comment without looking at your code, it is a good idea in general to move variables inside classes and expose them via properties. This is in accordance with OOP concept and is called "encapsulation". It makes for better code overall.
Hi,
I'm been waiting for your "next video" on OOP.
Do you plan to release it anytime soon?
Hi! I’d love to dive into OOP, but I’ve been waiting for a stronger response from viewers to make sure it’s something people want. You and just a couple others have shown interest so far. If more viewers want to see it, I’d be thrilled to create this content!
@@SiddharthRout The problem is not many VBA developers would be aware that it's possible to create VBA programs in an OO way.
I bet 99% of VBA developers have never heard of design patterns or SOLID principles, so obviously they won't be requesting it.
However, once you've introduced it, I'm sure you'll open up more interest.
I couldn't understand how event Works in class Module, you should have created this video in multiple parts in details by telling each and every concepts line by line.. 😂
I want to learn WithEvent and Raise Event concept in details, so make a Video on these topics as well.
The code in the downloaded workbook is different to the video.
Sub MyCarExperience()
CreateNewCar
FillFuel
DriveTheCar
Dim CarTyreState As Double
CarTyreState = TheCar.TheTyre.TyreCondition
If CarTyreState < 40 Then
MsgBox "Car Tyre Condition: " & CarTyreState & "." _
& vbNewLine & "We will replace tyres now"
Set TheCar.TheTyre = New Tyre
MsgBox "Car tyres have been replaced."
MsgBox "Car Tyre Condition: " & CarTyreState & "."
End If
Set TheCar = Nothing
End Sub
This line is wrong in the download:
MsgBox "Car Tyre Condition: " & CarTyreState & "."
but it's correct in the video.
Thank you for bringing it to my notice. Will check and rectify it within 24 hours :)
Fixed! Thanks again.