How to use Early and Late Binding the right way!

  Рет қаралды 11,465

Excel Macro Mastery

Excel Macro Mastery

Күн бұрын

Пікірлер
@oxand1
@oxand1 Ай бұрын
It's simple. It's clear. Perfect. Thanks a lot sir !
@netizencapet
@netizencapet Жыл бұрын
This was a better explanation than several webpages I reviewed. THANK YOU.
@redangrybird7564
@redangrybird7564 2 ай бұрын
Hi Paul, you have taught this old dog a new trick. Thanks a lot. 😎👍
@jimfitch
@jimfitch 2 жыл бұрын
Excellent! Oh, I wish I knew this a long time ago. Proof that it’s never too later to learn. Thanks, Paul
@Excelmacromastery
@Excelmacromastery 2 жыл бұрын
You're welcome Jim.
@gameon550
@gameon550 2 жыл бұрын
Wow , excellent , I have been waiting this video for a long time , you have changed my approach to any VBA project I will work in
@trantuananh1961
@trantuananh1961 Жыл бұрын
Thanks for your sharing. Now I understand more deeply about early & late binding.
@wayneedmondson1065
@wayneedmondson1065 2 жыл бұрын
Another great lesson and video! Thanks Paul! Thumbs up!!
@Excelmacromastery
@Excelmacromastery 2 жыл бұрын
Thanks again Wayne!
@julioccorderoc
@julioccorderoc Жыл бұрын
If I just have watched this video 2 months ago... I'd saved a lot of time
@jonkirk2118
@jonkirk2118 2 жыл бұрын
This is absolute gold. Many thanks!
@Excelmacromastery
@Excelmacromastery 2 жыл бұрын
Glad you like it
@jonkirk2118
@jonkirk2118 2 жыл бұрын
@@Excelmacromastery I was switching between early and late but not using the #. That's really useful. Apparently early binding gives a considerable performance increase over late, but I've not tested that. Early is especially useful for automation using other applications, even outside MS Office, such as MapInfo, SPSS, etc. but as you rightly point out, versioning is a problem. This happens during big upgrades when people start to get a new version of MS Office. Roll-outs can be very gradual. Some would say glacial.
@Excelmacromastery
@Excelmacromastery 2 жыл бұрын
I've read the performance is better with early but I haven't tested it either.
@Excelmacromastery
@Excelmacromastery 2 жыл бұрын
Let me know in the comments below, how you use binding in your code...
@SolutionsByPVV
@SolutionsByPVV 2 жыл бұрын
Oh Paul, that's a great solution!
@Excelmacromastery
@Excelmacromastery 2 жыл бұрын
Thanks
@brettnelson1592
@brettnelson1592 2 жыл бұрын
You solved so many problems for me in 10 minutes 🎉
@Excelmacromastery
@Excelmacromastery 2 жыл бұрын
Glad it was useful
@guwu4091
@guwu4091 2 жыл бұрын
Really brilliant approach for late and early binding! Just a comment regarding the scripting runtime library: As this library has not changed for ages I think it does not do any harm if you always use early binding in this case. Another comment: The library you use has to be installed on the target system regardless of one uses early or late binding.
@danielmwippel
@danielmwippel Жыл бұрын
Hi, Do you know if there is a way to avoid excel showing the error message when the library is not installed?
@pbs36
@pbs36 2 жыл бұрын
And this is why I always use late binding. The problems from users having different versions of the DLLs are just not worth the pros of early binding. Also, as we get more experienced, we can live well without it. Great explanation of the pros/cons and possible workarounds to still use early binding.
@Excelmacromastery
@Excelmacromastery 2 жыл бұрын
Very true - with more experience there is less of a need for early binding.
@abcd2-k4s
@abcd2-k4s 2 жыл бұрын
How can data save excel to access late binding please share any file for better knowledge
@Jocedu06
@Jocedu06 2 жыл бұрын
Brilliant
@johnwayne8059
@johnwayne8059 2 жыл бұрын
Clever and smart! I like it very much!👍👍👍 Thanks Paul!😁💚🍀🤟😎
@jacksonmacd
@jacksonmacd 2 жыл бұрын
I've dabbled with early and late binding in a large MS Access application, but always found it cumbersome to switch between the two methods. Your solution with conditional compilation is a game changer. Thanks very much
@Excelmacromastery
@Excelmacromastery 2 жыл бұрын
You're welcome Jack.
@hammeedabdo.82
@hammeedabdo.82 2 жыл бұрын
Thank you Mr. Paul for the nice video. Why don't you create a complete VBA course on Udemy?
@edgarsantarosa9847
@edgarsantarosa9847 2 жыл бұрын
That would be amazing
@CaseNav
@CaseNav Жыл бұрын
If we don't want to implement a way to change to late binding before providing the .xlsm to another person, what exactly is the restriction to communicate to the other person so they don't have a DLL issue?
@urielramirez27
@urielramirez27 2 жыл бұрын
Masterfull as always. I needed this video 5 years ago. I always used late binding and haven’t intellisense really slow you down. Will the code still working with the external library enums? I. E. acFormatXLS12 ? I usually have to convert them to their actual value, I. E. Instead of acFormatXLS12, I had to use 8 for example when I use late binding.
@Excelmacromastery
@Excelmacromastery 2 жыл бұрын
Glad it was helpful! For Late Binding you need to convert them because you don't have access to the library before runtime.
@OmkarUmbre
@OmkarUmbre 2 жыл бұрын
In suppose throughout any code, we need to check if the another application is open or closed how can we do that (not using API and I am using sendkeys). I don't want to set everywhere if else statements...
@averagebodybuilder
@averagebodybuilder 2 жыл бұрын
I always use late binding. No exceptions. My VBA code is always usable.
@Excelmacromastery
@Excelmacromastery 2 жыл бұрын
IntelliSense can be useful for development if you're not familiar with the library
@guwu4091
@guwu4091 2 жыл бұрын
What if the library you use is not installed on the target system for whatever reason?
@KillragtshirtsMusic
@KillragtshirtsMusic Жыл бұрын
@@guwu4091 exactly. If the dev is accessing functions from a later version and that version is not on the target system it aint going to matter which method you use. Hence the reason for standard operating environment and good dev ops practices.
@maddinenirajeshbabu3143
@maddinenirajeshbabu3143 2 жыл бұрын
Thank you very much I am having one regarding protection of code how to strongly protect vba project with out cracking the password is there any
@Excelmacromastery
@Excelmacromastery 2 жыл бұрын
There is third party software available or you need to use a different language like c# and vsto.
@MeTalkPrettyOneDay
@MeTalkPrettyOneDay 2 жыл бұрын
Ha! Just last week I was trying to debug some old access code and couldn't figure our what was up with a DLL error. This video would have been so convenient.
@UltimateBargains
@UltimateBargains 2 жыл бұрын
Somehow, KZbin has screwed up video resolutions above 480p.
@Excelmacromastery
@Excelmacromastery 2 жыл бұрын
I don't see any problem with it?
@vkpunique
@vkpunique 2 жыл бұрын
Hey Paul, Big fan of your work. Just a small feedback, your download link is not working for me and this is not first video. it's happening on all of your videos. I am using Edge.
@abcd2-k4s
@abcd2-k4s 2 жыл бұрын
Sir one problem Excel to access late binding data save , update etc problem hai Waiting for your response
@peterwooldridge7285
@peterwooldridge7285 2 жыл бұрын
Tempts me to come our of retirement and get back into the game....not really. A really useful video as per usual Cheers
@Excelmacromastery
@Excelmacromastery 2 жыл бұрын
Thanks Peter
@thegrantjames
@thegrantjames 2 жыл бұрын
My projects never get big enough for me to struggle with switching to late binding later on. Ofc, they are usually one and done type deals.
@Excelmacromastery
@Excelmacromastery 2 жыл бұрын
It's good when you can get away with it.
@Maxseven777
@Maxseven777 2 жыл бұрын
I think "Early" and "Late" are poor names for these two different ways of doing bindings. They should be called Compile and Runtime bindings. Just saying 😁
@KLiCuk1
@KLiCuk1 Жыл бұрын
This is very frustrating... did anyone else get runtime error 451 ? Sub Early() ' WORKS FINE Dim myDictionary As Dictionary Set myDictionary = New Dictionary myDictionary.Add "Apple", 1 Debug.Print myDictionary.Count Debug.Print myDictionary.Keys(0) End Sub Sub Late() ' RUNTIME ERROR 451 Dim myDictionary As Object Set myDictionary = CreateObject("Scripting.Dictionary") myDictionary.Add "Apple", 1 Debug.Print myDictionary.Count Debug.Print myDictionary.Keys(0) End Sub
@KLiCuk1
@KLiCuk1 Жыл бұрын
I had to search around for the solution which is... Debug.Print myDictionary.Keys(0) needs to be Debug.Print myDictionary.Keys()(0) in the late bound version. (extra parenthess) It appears that early bound code doesn't always translate into late bound code. However, the extra parenthesis will work in the early bound version.
@Excelmacromastery
@Excelmacromastery Жыл бұрын
It's a subtle one. If you check this table you can see the differences between using early and late binding(excelmacromastery.com/vba-dictionary/#A_Quick_Guide_to_the_VBA_Dictionary)
@KLiCuk1
@KLiCuk1 Жыл бұрын
@@Excelmacromastery Thanks for the reply, I see you did have it covered. I'm not sure what the reason for the empty parenthesis is though?
Class Modules in VBA: Made Super Simple
17:43
Excel Macro Mastery
Рет қаралды 37 М.
How to treat Acne💉
00:31
ISSEI / いっせい
Рет қаралды 108 МЛН
How Strong Is Tape?
00:24
Stokes Twins
Рет қаралды 96 МЛН
Что-что Мурсдей говорит? 💭 #симбочка #симба #мурсдей
00:19
How to Use Class Interfaces in Excel VBA
20:16
Excel Macro Mastery
Рет қаралды 83 М.
Reduce VBA Errors by 90% (with this little-known Method)
16:59
Excel Macro Mastery
Рет қаралды 59 М.
How To Programmatically Add Library References Using VBA
16:41
Sigma Coding
Рет қаралды 16 М.
Watch these 28 minutes if you want to become an Advanced VBA user...
29:01
Excel Macro Mastery
Рет қаралды 57 М.
Use Excel VBA to Read API Data
20:48
Excel Macro Mastery
Рет қаралды 144 М.
How to use Class Modules with the VBA Dictionary
14:30
Excel Macro Mastery
Рет қаралды 52 М.
How to Use vbScript to Open and Work with Data in Access accdb Files - Late Binding Example
12:12
Creating Classes in VBA
10:19
Jennifer Garth
Рет қаралды 19 М.
How to get the Last Row in VBA(The Right Way!)
15:41
Excel Macro Mastery
Рет қаралды 168 М.