Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16

Thread: What is early binding and late binding

  1. #11
    Board Regular
    Join Date
    Jul 2012
    Location
    India
    Posts
    104
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default Re: What is early binding and late binding

    Hi,
    Can anyone please review below code and guide me if possible.
    I have copied early binding instance from the code and tried to convert it to late binding.

    Could you please confirm if am doing it correct way. Thanks.

    Public X__App As Excel.Application
    Public x__Wb As Workbook
    Public x__ws As Worksheet

    Sub Test()
    'Ealry binding
    Set X__App =CreateObject("Excel.Application")
    Set x__Wb = X__App.Workbooks.Open(XX__PATH &"Test\Test.xlsb", False, True)

    'Late Binding
    Dim X__App As Object
    Dim x__Wb As Object
    Dim x__Wb As Object

    Set X__App =CreateObject("Excel.application")
    Set x__Wb = X__App.Workbooks.Open(XX__PATH &"Test\Test.xlsb", False, True)
    Set x__ws = x__Wb.Worksheets("Test")
    End Sub
    Last edited by BizBoy; Oct 17th, 2019 at 10:41 AM.

  2. #12
    MrExcel MVP
    Moderator
    RoryA's Avatar
    Join Date
    May 2008
    Location
    UK
    Posts
    33,986
    Post Thanks / Like
    Mentioned
    52 Post(s)
    Tagged
    6 Thread(s)

    Default Re: What is early binding and late binding

    The late binding is correct but you would of course need to remove the early bound Public variables.

  3. #13
    Board Regular
    Join Date
    Jul 2012
    Location
    India
    Posts
    104
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default Re: What is early binding and late binding

    Hi RoryA sir, yes, you are correct. These were kept just as a reference to post.
    Have a nice day ahead.

  4. #14
    Board Regular
    Join Date
    Jul 2012
    Location
    India
    Posts
    104
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default Re: What is early binding and late binding

    Hi Experts,

    I have a question. If I change a code from Early Binding to Late Binding, will there be any difference in the output.
    If all the input parameters are same, will early or late binding affect the output in any way.

    My guess is, it should not, however I am not sure, hence seeking help.
    Can anyone please help me in this.

  5. #15
    MrExcel MVP
    Moderator
    RoryA's Avatar
    Join Date
    May 2008
    Location
    UK
    Posts
    33,986
    Post Thanks / Like
    Mentioned
    52 Post(s)
    Tagged
    6 Thread(s)

    Default Re: What is early binding and late binding

    No, there should be no difference.

  6. #16
    Board Regular
    Join Date
    Jul 2012
    Location
    India
    Posts
    104
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default Re: What is early binding and late binding

    Thanks a lot RoryA sir. Have a nice day ahead.

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •