+ Reply to Thread
Results 1 to 5 of 5

Remove missing reference, update outlook reference

  1. #1
    Forum Contributor
    Join Date
    08-19-2010
    Location
    N/A
    MS-Off Ver
    Excel 2010
    Posts
    151

    Remove missing reference, update outlook reference

    Hello,

    I have an excel xlsm file which includes Microsoft outlook reference.
    The file is opened in excel 2007 and excel 2010.

    When the file is opened in Excel 2007 after it is opened in Excel 2010
    I get a reference error message and a missing reference.

    I wish to dynamic update the reference - remove the missing outlook reference and add the correct one.

    I use the following code. If the reference is missing it adds it correctly.
    My problem: when there is a missing reference the code can not remove it and I get an error.

    Can you help me ?

    Thank you for your help

    Please Login or Register  to view this content.
    Last edited by Snoopy2003; 08-29-2011 at 08:37 PM.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Remove missing reference, update outlook reference

    Hello Snoopy2003,

    You can easily resolve this problem by using late binding in your code. The downside is you can not use named constants from the object library and you do not have the Intellisense to show you the various properties and methods of the object. The upside is you do not have to fiddle about with checking for and loading the correct library and removing missing references.

    Late Binding Example for Outlook
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Forum Contributor
    Join Date
    08-19-2010
    Location
    N/A
    MS-Off Ver
    Excel 2010
    Posts
    151

    Re: Remove missing reference, update outlook reference

    Hello,

    Thank you for the quick and helpful message.

    Your solution solved my problem.
    I was trying to solve it for weeks and did not find the solution.
    I always got an error when I tried to remove the missing references.
    I thought that the solution will be very complicated but yours is short & simple.

    Thank you very much for your time and support.
    No need to update the reference manually every time.

    I have another question:
    what are 'named constants' in outlook library? Where can I read about them ?

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Remove missing reference, update outlook reference

    Hello Snoopy2003,

    Named constants are usually prefixed with ol. Here is an example of the predefined named constants for the Default Folders. To find the constants for Outlook use the Object Browser in the Visual Basic Editor by pressing F2.

    Outlook Default Folder Constants and Values
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    08-19-2010
    Location
    N/A
    MS-Off Ver
    Excel 2010
    Posts
    151

    Re: Remove missing reference, update outlook reference

    Thank you for the detailed answer.

    Thank you for your support

+ 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