Keeping VBA Library References

  • I'm running Excel 2016 in Office 365 Pro Plus and am having a problem I haven't been able to find anywhere else. Specifically, virtually every time I open Tools > References in the VB Editor, the references that are selected have changed. There are 4 specific references where this is a problem:
    - Microsoft Visual Basic for Applications Extensibility 5.3
    - Microsoft Scripting Runtime
    - Microsoft Forms 2.0 Object Library
    - IlydaUK Ribbon Commander v1.1 (third-party add-in)
    One or more of the above 4 will be unchecked anytime I check after re-checking them.


    I read one apparently related post that suggested making sure all were checked in the personal workbook. I checked the ones that weren't and that lasted only about a hour, including in the personal workbook.


    I've also seen some posts that make reference to late vs. early binding but could never find any specifics about how to set that up.


    Any additional suggestions will be deeply appreciated.

  • Re: Keeping VBA Library References


    References are specific to a particular workbook, so setting them in one workbook will not affect any other ones.

    Rory
    Theory is when you know something, but it doesn’t work. Practice is when something works, but you don’t know why. Programmers combine theory and practice: nothing works and they don’t know why

  • Re: Keeping VBA Library References


    Thanks so much to both of you. I finally think I may be getting somewhere with this issue. Just to test my understanding:
    - If I'm running developed applications on my own PC, i.e. against the references I've put in my library, there shouldn't be a problem as long as I've added the required references once.
    - For distributed applications that use non-Excel applications, e.g., Outlook, Word, I should declare variables that refer to them as Object and then apply other data types as necessary when defining those variables.


    Will that serve as a rule of thumb for distributed applications?

  • Re: Keeping VBA Library References


    Hello again,


    Spot on ... :wink:


    Thanks ... for your Thanks ..:smile:

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Smiley" icon, below, in the bottom right corner :)

  • Re: Keeping VBA Library References


    It somewhat depends. If you know that your target environment will have machines that are all using the same version of Office and Windows, then early binding will perform better but otherwise, yes, late binding is the easiest way.

    Rory
    Theory is when you know something, but it doesn’t work. Practice is when something works, but you don’t know why. Programmers combine theory and practice: nothing works and they don’t know why

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!