Wise Owl Answers - What's the difference between early binding and late binding in VBA?

Поділитися
Вставка
  • Опубліковано 2 гру 2024

КОМЕНТАРІ • 52

  • @jacksonmacd
    @jacksonmacd 3 роки тому +1

    Excellent explanation. Your clarity and thoroughness is much appreciated.

    • @WiseOwlTutorials
      @WiseOwlTutorials  3 роки тому

      Thanks Jack, glad you found it useful and thank you for taking the time to leave a comment!

  • @dxfvgyhjh
    @dxfvgyhjh 3 роки тому

    16:11 I hope nobody needs late binding on this reference, Great Scott!

  • @urveelparmar7742
    @urveelparmar7742 2 роки тому +1

    this was so helpful, thank you so much!

  • @henrikijonkoping4694
    @henrikijonkoping4694 3 роки тому +2

    Very good! I will have use of this!

  • @PankajNegi007
    @PankajNegi007 3 роки тому +1

    Great Sir!!! What an Awesome Idea to convert Early Binding to Late Binding code. Thanks for this training session. I really enjoy Sir.

  • @bernhardkeppner6239
    @bernhardkeppner6239 3 роки тому +1

    Very very good explanation!!! This helps a lot!

    • @WiseOwlTutorials
      @WiseOwlTutorials  3 роки тому

      Glad you enjoyed it Bernhard, thank you for the comment!

  • @debbie6085
    @debbie6085 3 роки тому +1

    Thank you for explaining it so well.

    • @WiseOwlTutorials
      @WiseOwlTutorials  3 роки тому

      You're very welcome Debbie, thank you for watching!

  • @piotrkuc8936
    @piotrkuc8936 3 роки тому +1

    Thank you for another great video!

  • @terryy6938
    @terryy6938 3 роки тому +1

    Another great video!

  • @krn14242
    @krn14242 3 роки тому +1

    Thanks Andrew, great explanation of early versus late binding. I usually use late binding when creating emails from Excel. Just habit I guess.

    • @WiseOwlTutorials
      @WiseOwlTutorials  3 роки тому

      Thanks Kevin! You have a better memory than I do, I clearly rely on the IntelliSense too much!

  • @KhalilYasser
    @KhalilYasser 3 роки тому +1

    Thank you very much for these awesome videos.

  • @RohithKK-uh7pp
    @RohithKK-uh7pp 3 роки тому +1

    I am through the video, Very beautiful and nice explanations and informative as well. Thank you sir.

    • @WiseOwlTutorials
      @WiseOwlTutorials  3 роки тому +1

      That was fast! Glad you enjoyed it Rohith, thank you for watching!

  • @The7Immortals
    @The7Immortals 3 роки тому +2

    Nice Explanation..

  • @Meolimo
    @Meolimo 3 роки тому +1

    thks again from Montreal (Canada) :-))

  • @AnilKumar-vi8oe
    @AnilKumar-vi8oe 3 роки тому +1

    Great again, keep up the good work sir... U r sharing the vast knowledge with us... Happy to be a subsriber

    • @WiseOwlTutorials
      @WiseOwlTutorials  3 роки тому

      Thank you Anil, happy to hear that you enjoyed it!

  • @imranbhatti8580
    @imranbhatti8580 3 роки тому +2

    Nice Andrew. I was using late binding already but the new thing that I learnt in this video was to find the constants enumeration values right inside the VBE. late binding is a blessing for developers however I still could not find a way to use it for Mac users. Please let me know if you have any idea about that. Thanks

    • @WiseOwlTutorials
      @WiseOwlTutorials  3 роки тому +2

      Hi Imran! I'm afraid that my knowledge of VBA for Mac is extremely limited so I can't offer much advice on that. I always refer to Ron de Bruin for Mac Excel information www.macexcel.com/
      I don't know if he has information on that topic but it's worth a look!

  • @youssefsedkey7616
    @youssefsedkey7616 3 роки тому +1

    Thanks so much.

  • @hassanrozh6579
    @hassanrozh6579 3 роки тому +1

    Thanks a lot, it's awesome.

  • @ANUJMISHRA-su7qi
    @ANUJMISHRA-su7qi 3 роки тому +1

    Really good

  • @rolandtobiasz
    @rolandtobiasz 3 роки тому

    Great video, which inspired me for a question: How do you reference for early binding a library or a member of a class from within the code, instead of setting the reference in the Tools menu. Using your code, I would like to reference from within the code the ParagraphFormat class and it's members, specifically from your example the member Alignment to understand the constant/member wdAlignParagraphCenter. I hope I'm writing this correctly.

    • @WiseOwlTutorials
      @WiseOwlTutorials  3 роки тому

      Hi Roland! Yes you can add references to object libraries programmatically using two different methods:
      docs.microsoft.com/en-us/office/vba/language/reference/user-interface-help/addfromfile-method-vba-add-in-object-model
      docs.microsoft.com/en-us/office/vba/language/reference/user-interface-help/addfromguid-method-vba-add-in-object-model
      You can see more useful examples in the answers to this post stackoverflow.com/questions/3837720/how-do-i-programatically-add-a-reference-to-a-vba-project
      I hope it helps!

  • @hamohd70
    @hamohd70 3 роки тому

    what does it mean if a "class not registered" error is received and how to resolve it?

    • @WiseOwlTutorials
      @WiseOwlTutorials  3 роки тому

      Hi there! It's difficult to say without more details. What does your code look like and which line is causing the problem?
      Perhaps these might help
      stackoverflow.com/questions/62239548/vba-selenium-class-not-registered-80040154
      answers.microsoft.com/en-us/msoffice/forum/msoffice_excel-mso_win10-mso_365hp/previously-working-macro-enabled-file-now-throwing/600cc674-733a-4481-9cd1-1f836df9be84

  • @shinrafahell
    @shinrafahell 3 роки тому

    I've heard that some libraries run faster when using early binding such as dictionary libraries. I'm not sure though.

    • @WiseOwlTutorials
      @WiseOwlTutorials  3 роки тому

      Hi Rafael, I hadn't heard this, that's interesting, thank you for sharing!

  • @twiddle7125
    @twiddle7125 3 роки тому

    Just one question about early binding. I find it convenient to use the New keyword when declaring the variable all in one line. Is there any reason why this shouldn't be done?

    • @WiseOwlTutorials
      @WiseOwlTutorials  3 роки тому +1

      Hi there! There are some very minor reasons why you might consider not using that style of variable declaration:
      1 - You can't test if the variable Is Nothing because as soon as you reference it, it instantly becomes something (as the most likely reason for testing that it Is Nothing is because you want to make it something, this is rarely a problem).
      2 - The variable is tested for Nothing each time it is referenced adding an overhead at runtime (but this has a negligible impact on performance so again, not a problem).
      I use either technique depending mainly on what mood I'm in. Others have stronger feelings on the subject www.cpearson.com/excel/DeclaringVariables.aspx
      I hope that helps!

    • @jacksonmacd
      @jacksonmacd 3 роки тому

      I am no expert on this, but i understand you can create only one instance of the object with the single line format, but any number of objects with the separate line format.

  • @edtardaguila3599
    @edtardaguila3599 3 роки тому

    hi what if i transfer the file where the word library activated reference to multiple users? do they need to activate the library for each users ? the same way that you did in the original file or no need to do that?

    • @WiseOwlTutorials
      @WiseOwlTutorials  3 роки тому

      Hi Ed! If you set a reference to an object library using Tools | References like in the original file you can give this file to other users and if they have the same version of the software installed then they don't need to do anything.
      I hope that helps!

    • @edtardaguila3599
      @edtardaguila3599 3 роки тому

      @@WiseOwlTutorials yes got that, but what if we are the not same version and some references and libraries on the wnd users are not set what if i forward the to a hundred user do they need to set the references and libraries. before using the file

    • @WiseOwlTutorials
      @WiseOwlTutorials  3 роки тому +1

      @@edtardaguila3599 Hi Ed! If you're using early binding and your users have different versions then they will need to resolve the missing references as shown in the video, yes. I hope that helps!

    • @edtardaguila3599
      @edtardaguila3599 3 роки тому +1

      @@WiseOwlTutorials thanks i got it clear :)

    • @WiseOwlTutorials
      @WiseOwlTutorials  3 роки тому

      @@edtardaguila3599 You're welcome Ed!