Consulting

Results 1 to 6 of 6

Thread: Need Help Attaching VBAProject Reference

  1. #1
    VBAX Regular
    Joined
    Aug 2005
    Posts
    17
    Location

    Need Help Attaching VBAProject Reference

    Hi. I am using Office 2003.

    I made an excel file which includes the reference
    Office Word 11.0 Object library within it. All macros
    in this excel file work fine. I saved this file to be
    backwards compatible (to be able to work with
    earlier Excel versions).

    I emailed this same file to a friend, who has Excel
    2003. When he runs the same macros within it, he
    gets an error message that this reference (the Office
    Word 11.0 Object library) is not found. Thus, the
    dependent code does not work on his end.

    I thought that when I saved my excel file to include this
    reference and gave him a copy, that any user with the
    same copy should be able to access/use the same
    specified library item(s) automatically.

    If I am wrong in this, could you please tell me if there
    is any VBA code that could automatically check to see
    if the needed library reference was "attached" (included)
    and if not, would indeed attach/include itself prior to
    running any macro code?

    Also, if an intended user did have an earlier Excel version,
    could VBA code be added that could determine the Excel
    version and find the correct matching reference in the
    library and attach it? For example, while Excel 2003
    "matches" with Office Word 11.0 object library, an earlier
    Excel version may need a different Word xx.x object in
    order to function properly.

    Thank you very much.

    Ken

  2. #2
    VBAX Mentor Marcster's Avatar
    Joined
    Jun 2005
    Posts
    434
    Location
    could you please tell me if there
    is any VBA code that could automatically check to see
    if the needed library reference was "attached" (included)
    and if not, would indeed attach/include itself prior to
    running any macro code?
    There's some KB entries regarding this,
    Here's what I've found:

    Add a VBA Reference Library via code
    http://vbaexpress.com/kb/getarticle.php?kb_id=267
    Remove Missing VBA Library References via code
    http://vbaexpress.com/kb/getarticle.php?kb_id=272
    Determine the File Path or GUID to a VBA Reference Library
    http://vbaexpress.com/kb/getarticle.php?kb_id=278
    List all Checked GUIDS
    http://vbaexpress.com/kb/getarticle.php?kb_id=713

    HTH,

    Marcster

  3. #3
    MS Excel MVP VBAX Tutor
    Joined
    Mar 2005
    Posts
    246
    Location
    Or you could take the lazy way out, and use late binding. People claim there's a performance penalty, but your users are not likely to notice. Here's a brief introduction:

    http://peltiertech.com/Excel/EarlyLateBinding.html
    - Jon
    -------
    Jon Peltier, Microsoft Excel MVP
    Peltier Technical Services
    Tutorials and Custom Solutions
    http://PeltierTech.com
    _______

  4. #4
    VBAX Regular
    Joined
    Aug 2005
    Posts
    17
    Location
    Thank you so very much, Marcster and Jon. Your help is
    much appreciated.

    Ken

  5. #5
    VBAX Mentor Marcster's Avatar
    Joined
    Jun 2005
    Posts
    434
    Location
    I'm glad to be able to help .
    Any other problems/questions, let us know.

    Marcster.

  6. #6
    Moderator VBAX Master geekgirlau's Avatar
    Joined
    Aug 2004
    Location
    Melbourne, Australia
    Posts
    1,464
    Location
    Hi Ken,

    Don't forget to mark your post as "Solved" - you can do this via the "Thread Tools" option at the top of the screen.

Posting Permissions

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