Results 1 to 3 of 3
  1. #1
    5 Star Lounger
    Join Date
    Jul 2001
    Location
    NJ, USA
    Posts
    617
    Thanks
    0
    Thanked 0 Times in 0 Posts

    references, different versions of Library (Access03)

    I have a large database that I have been building over the last couple of years with a lot of support from you guys. The other week I added a reference to Microsoft Word 11 Library. Everything worked okay on my system, but the secretary is using Version 10. She started getting a message something like date function not declared. I looked in her reference section and it states that Library 11 is missing. I manually set the reference to Library 10 and everything works okay until after she logs out and relogs into her computer she get the message again. How do I deal with this? Thank you. Fay

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: references, different versions of Library (Access03)

    Hello Fay,

    Missing references are one of the banes of developers.

    The general rule is: if you set a reference to one of the Office applications, the reference will automatically update itself if you open the database in a newer version. For example, if you work in Access 2000 (version 9.0), and set a reference to the Microsoft Excel 9.0 Object Library, then open the database in Access 2002 (version 10.0) or Access 2003 (version 11.0), the reference will automatically point to the 10.0 or 11.0 version of the object library.

    However, this does not work if you move from a later version to an earlier version: you developed the database in Access 2003, and if you open it in Access 2000 or 2002, you'll get an error message.

    One solution is to open the database in the earliest version of Access that you need to support, set all references correctly, then distribute this copy of the database.

    Another option is to use late binding.This means:

    - Replace all declarations of the type Dim w As Word.Application or Dim w As Word.Document etc. with Dim w As Object.
    - Use CreateObject to create the Word.Application object instead of the New keyword: Set w = CreateObject("Word.Application")
    - Replace all Word VBA constants such as wdSaveChanges with their numeric value - you can look up these values in the Object Browser.
    - Finally, remove the reference to the Word object library.

    If you use late binding, the code should run on all PCs with a version of Word, unless you used features that are specific to Word 2003.

  3. #3
    5 Star Lounger
    Join Date
    Jul 2001
    Location
    NJ, USA
    Posts
    617
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: references, different versions of Library (Access03)

    Thank you Hans for your response. It is good to know I didn't screw up. I was getting ready to work with printing specific reports from the database.

    Okay I will remove the reference from the database in my computer and reapply it for the older computer and see if that works. Thank you. Fay

Posting Permissions

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