+ Reply to Thread
Results 1 to 10 of 10

New to Late Binding in VBA -- Would appreciate Help.

  1. #1
    Registered User
    Join Date
    02-15-2013
    Location
    Granby
    MS-Off Ver
    Excel 2007
    Posts
    5

    New to Late Binding in VBA -- Would appreciate Help.

    Hi there,
    Like i mentionned in the title, i'm not used with the "Late binding" Method. I have a problem with one Workbook here, some people are using Office 2007 and other are now using Office 2010 ... other tried 2013 i think ... That, generate an error "Can't load DLL" for those still using Office 2007. Through my research, i found that if i'm programming the macros using the late binding method, that won't be a problem anymore.

    Here's my original code using the "Early binding method" :

    Please Login or Register  to view this content.
    I tried something using the "Late binding" method but it didn't work at all, here it is :

    Please Login or Register  to view this content.
    Thank you very much for any help !
    Last edited by d0Tork0b; 02-16-2013 at 09:44 AM.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643
    Where is this code located?

    If it's in Excel you shouldn't be using any kind of binding.
    Last edited by Norie; 02-15-2013 at 12:48 PM.
    If posting code please use code tags, see here.

  3. #3
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: New to Late Binding in VBA -- Would appreciate Help.

    Hi, d0Tork0b,

    if you start a new excel instance there isnopthing active - no workbook, no worksheet. You need to open a workbook, get the active sheet, and then proceed with the code.

    I agree with Norie - could you explain why you want to use Late Binding (I would rely on interactive applications for that)?

    And could you please add Code Tags around the procedures (as requested by Forum Rule #3)? Thanks.

    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  4. #4
    Registered User
    Join Date
    02-15-2013
    Location
    Granby
    MS-Off Ver
    Excel 2007
    Posts
    5

    Post Re: New to Late Binding in VBA -- Would appreciate Help.

    Hi Norie and Hahobe,

    First of all, thanks for the reply. This code is in the worksheet (I forgot to mention that it's in Office Excel) and it's working fine, but as soon as someone open it with excel 2013 for example, it creates a "Missing reference in the VBA Reference ("can't load DLL"). I went to VBA --> Tools --> References ... there's the "Outlook 15.0 Object Library" that is "Missing". So, each time I have the error, i must close the workbook, reopen it, let Excel 2007 "try to "Repair" it, go there, uncheck the "Missing" object library, Save and after it'll work normally until someone using 2013 opens it again ... basically this is why i began some research on the subject and I found that using Late binding would be working with any version of excel without using the "References". I created a "Sample" since i don't have the original file on hand during the week end (it's at my work), but it's basically the same with all the months and other "Buttons" that will automatically format the selected cell when it's clicked. For example, you have "someone" that is present on the second of February 2013, there is a button for "Presence" and all kind of status. Let me know what you think of it and thank you again
    Attached Files Attached Files
    Last edited by d0Tork0b; 02-16-2013 at 10:25 AM.

  5. #5
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: New to Late Binding in VBA -- Would appreciate Help.

    That sounds more like the problem is with Outlook, nothing to do with Excel.

    It's Outlook you should be late/early binding, not Excel.

    If you use early binding you shouldn't have the version problems you described.

    The question is then, are you automating Outlook?

  6. #6
    Registered User
    Join Date
    02-15-2013
    Location
    Granby
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: New to Late Binding in VBA -- Would appreciate Help.

    Well there's nothing more than the "Original" automation in outlook, for example, no macros ... Only Outlook. I really don't understand why it's doing this though. Couldn't find any "Clear" answer nowhere on internet but the "Late binding" method. this is why i wanted to try this. If you have any idea, they are welcome The thing is that there is one "calendar" per worker. In the futur, i would like to integrate this calendar to the website but they're not ready to let me do that for now so i have to find a solution with Excel to accomodate them. Also, as soon as the error occur for one, it's occuring for every file (They are located on a network drive accessible by every person that can edit them) ... I really have no clue why it's doing this and it's really annoying.

    Thanks for taking the time

  7. #7
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: New to Late Binding in VBA -- Would appreciate Help.

    What do you mean by the 'original' automation?

    Do you have code in the Excel workbook that automates Outlook?

    For example, something that generates and sends an email or, since you mentioned calendars, creates appointments/meetings.

  8. #8
    Registered User
    Join Date
    02-15-2013
    Location
    Granby
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: New to Late Binding in VBA -- Would appreciate Help.

    Nope, absolutely not ...

    Also, the "Outlook 12.0 Object library" is checked and i can't uncheck it since it tells me that it's in use. But there is no code automating Outlook in this file.

  9. #9
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: New to Late Binding in VBA -- Would appreciate Help.

    Outlook must be used somewhere, otherwise that reference wouldn't be needed.

    Do you have any add-ins?

    What code is in the workbook?

    Can you attach the actual workbook, without any sensitive data of course?

  10. #10
    Registered User
    Join Date
    02-15-2013
    Location
    Granby
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: New to Late Binding in VBA -- Would appreciate Help.

    As soon as i go back to work, monday, i'll do that

    Thanks again.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1