Results 1 to 8 of 8
  1. #1
    4 Star Lounger
    Join Date
    Feb 2001
    Location
    Richland, Washington, USA
    Posts
    407
    Thanks
    0
    Thanked 0 Times in 0 Posts

    MISSING Object Libraries (2002/2003)

    While developing a database, I'm moving it between two machines -- one has Access 2002 and the other has Access 2003. After each move, it seems like I have to go to the VBA editor, look at Tools...References and resolve the "MISSING" items (usually involving switching from version 10 of an Office object library to version 11, or vise versa). Is there any way to avoid this (besides upgrading to Access 2003 on the one machine)?

    Thanks.

  2. #2
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: MISSING Object Libraries (2002/2003)

    If you're writing code using one of the Word objects, it might be usefull to do a search for Late Binding.

    By using late binding, your application shouldn't be affected whichever version you are using.

  3. #3
    4 Star Lounger
    Join Date
    Feb 2001
    Location
    Richland, Washington, USA
    Posts
    407
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: MISSING Object Libraries (2002/2003)

    I'm using Word, Outlook, and Excel objects. So, declaring them all as "Object" rather than the specific object type will solve the problem? I've heard that late binding slows things down -- in reality, is this much of an issue?

    Thanks, Dave.

  4. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: MISSING Object Libraries (2002/2003)

    It depends on what you're doing. It will allow the code to compile. However, you still need references to those object libraries, even if you use late binding. Late binding just means you declare something as an Object and then set the object variable by creating an instance of, say, a Word Application. You still need the Word object library reference, but if it isn't there, the code will still compile. If you explain exactly what you're trying to do, perhaps someone can give you specific help.
    Charlotte

  5. #5
    4 Star Lounger
    Join Date
    Feb 2001
    Location
    Richland, Washington, USA
    Posts
    407
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: MISSING Object Libraries (2002/2003)

    Okay, here's a simple example of what I'm doing: I have some VBA code that creates an Outlook message. The routine declares <font face="Georgia"><font color=blue>Dim objMessage as MailItem</font color=blue></font face=georgia>. I'm using Access 2003. I give the .mdb file to someone else to test. He's using Access 2002. He can't run it because "Microsoft Outlook 11.0 Object Library" is MISSING in the References list. If we scroll down the list to "Microsoft Outlook 10.0 Object Library" and reference that, then the code works.

    Dave seemed to indicate that if I declare <font face="Georgia"><font color=blue>Dim objMessage as Object</font color=blue></font face=georgia> instead (i.e., late binding), we won't have this "compatibility" problem (i.e., we won't have to "realign" the references). Charlotte, you seem to indicate otherwise.

  6. #6
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: MISSING Object Libraries (2002/2003)

    You won't have to change the *code*, but you will still have to clean up the reference. Sorry, but late binding isn't magic, it just allows you to set an object to an instance of the Outlook version running on that machine. A broken reference will mess up more than just the code that specifically uses it. In fact, you can have a broken reference that you don't even use and it will cause you grief.
    Charlotte

  7. #7
    4 Star Lounger
    Join Date
    Feb 2001
    Location
    Richland, Washington, USA
    Posts
    407
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: MISSING Object Libraries (2002/2003)

    Thanks for the help, Charlotte. I'm curious, how do the "pros" ensure that a "professional" application will run across different Office versions if the application includes this sort of automation code? Is it still a problem if an MDE file created? Or do they just avoid references to other Office object libraries?

  8. #8
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: MISSING Object Libraries (2002/2003)

    It's a worse problem in an MDE because references can't be changed there and they don't really resolve themselves even when they compile. We've run into problems occasionally, so we tend to use the generic code to output to another app, etc., instead of automation. You can fix references in code, but it requires fully referenced code that runs before any other code and lives in a separate module, so that it loads and runs without tripping over the broken reference.
    Charlotte

Posting Permissions

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