+ Reply to Thread
Results 1 to 10 of 10

Reference Libraries

  1. #1
    ben
    Guest

    Reference Libraries

    I use excel to control mailing of workbooks automatically using outlook. So
    in my excel file I have the Outlook 11.0 reference file added in which is
    associated with Outlook 2003, Unfortunately I have people using Outlook 2000
    also which is using Outlook 9.0 reference library. When the excel workbook is
    run a machine with outlook 2000 every macro errors because the reference to
    the Outlook 11.0 library is not found. Is there a way to include backwards
    compabtibilty here???????
    Please help....
    ben
    --
    When you lose your mind, you free your life.

  2. #2
    Fredrik Wahlgren
    Guest

    Re: Reference Libraries


    "ben" <[email protected](remove this if mailing direct)> wrote in message
    news:[email protected]...
    > I use excel to control mailing of workbooks automatically using outlook.

    So
    > in my excel file I have the Outlook 11.0 reference file added in which

    is
    > associated with Outlook 2003, Unfortunately I have people using Outlook

    2000
    > also which is using Outlook 9.0 reference library. When the excel workbook

    is
    > run a machine with outlook 2000 every macro errors because the reference

    to
    > the Outlook 11.0 library is not found. Is there a way to include backwards
    > compabtibilty here???????
    > Please help....
    > ben
    > --
    > When you lose your mind, you free your life.


    I think so. When you have a reference set, you use what is known as early
    binding, Thismeans that you can declare a varible to that object as Dim o As
    Outlook.Application without VBA making a complaint. VBA can now make use of
    Intellisense to show all the methods offered by Outlook.

    I think you should be able to use late binding. This means that you remove
    the reference to outlook and then have code similar to this

    Dim o As Object
    Set o = CreateObject("Outlook.Application")

    You won't have Intellisense but the code should now work with either version
    as long as you don't try to call a method that exists in one version only.
    To make coding easier, do this change as the last step.

    /Fredrik



  3. #3
    Bob Phillips
    Guest

    Re: Reference Libraries

    You are referring to late binding, which doesn't bind to the application
    type library at development/compile time, but makes multiple calls at
    runtime.

    Essentially, rather than setting a reference to the type library via
    Tools>References, and then declaring an object of type Outlook.Application
    or whatever, you create a generic Object variable and create that object
    rather than just New.

    You lose access to the application's object model and intellisens when you
    do this, but there is another way, what I call Develop Early, Release Late.
    An example is given (using Outlook) at
    http://www.xldynamic.com/source/xld.EarlyLate.html

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "ben" <[email protected](remove this if mailing direct)> wrote in message
    news:[email protected]...
    > I use excel to control mailing of workbooks automatically using outlook.

    So
    > in my excel file I have the Outlook 11.0 reference file added in which

    is
    > associated with Outlook 2003, Unfortunately I have people using Outlook

    2000
    > also which is using Outlook 9.0 reference library. When the excel workbook

    is
    > run a machine with outlook 2000 every macro errors because the reference

    to
    > the Outlook 11.0 library is not found. Is there a way to include backwards
    > compabtibilty here???????
    > Please help....
    > ben
    > --
    > When you lose your mind, you free your life.




  4. #4
    ben
    Guest

    Re: Reference Libraries

    thanks
    I understood about late binding but i did not think about dim and setting
    the objects differently
    much appreciation.

    "Bob Phillips" wrote:

    > You are referring to late binding, which doesn't bind to the application
    > type library at development/compile time, but makes multiple calls at
    > runtime.
    >
    > Essentially, rather than setting a reference to the type library via
    > Tools>References, and then declaring an object of type Outlook.Application
    > or whatever, you create a generic Object variable and create that object
    > rather than just New.
    >
    > You lose access to the application's object model and intellisens when you
    > do this, but there is another way, what I call Develop Early, Release Late.
    > An example is given (using Outlook) at
    > http://www.xldynamic.com/source/xld.EarlyLate.html
    >
    > --
    >
    > HTH
    >
    > RP
    > (remove nothere from the email address if mailing direct)
    >
    >
    > "ben" <[email protected](remove this if mailing direct)> wrote in message
    > news:[email protected]...
    > > I use excel to control mailing of workbooks automatically using outlook.

    > So
    > > in my excel file I have the Outlook 11.0 reference file added in which

    > is
    > > associated with Outlook 2003, Unfortunately I have people using Outlook

    > 2000
    > > also which is using Outlook 9.0 reference library. When the excel workbook

    > is
    > > run a machine with outlook 2000 every macro errors because the reference

    > to
    > > the Outlook 11.0 library is not found. Is there a way to include backwards
    > > compabtibilty here???????
    > > Please help....
    > > ben
    > > --
    > > When you lose your mind, you free your life.

    >
    >
    >


  5. #5
    Fredrik Wahlgren
    Guest

    Re: Reference Libraries


    "Bob Phillips" <[email protected]> wrote in message
    news:uV2jWu%[email protected]...
    > You are referring to late binding, which doesn't bind to the application
    > type library at development/compile time, but makes multiple calls at
    > runtime.
    >
    > Essentially, rather than setting a reference to the type library via
    > Tools>References, and then declaring an object of type Outlook.Application
    > or whatever, you create a generic Object variable and create that object
    > rather than just New.
    >
    > You lose access to the application's object model and intellisens when you
    > do this, but there is another way, what I call Develop Early, Release

    Late.
    > An example is given (using Outlook) at
    > http://www.xldynamic.com/source/xld.EarlyLate.html
    >
    > --
    >


    Develop Early, Release Late ? That sounds like something I want to
    remember. Nice!

    /Fredrik



  6. #6
    Bob Phillips
    Guest

    Re: Reference Libraries


    "Fredrik Wahlgren" <[email protected]> wrote in message
    news:OgoVR1%[email protected]...

    > Develop Early, Release Late ? That sounds like something I want to
    > remember. Nice!


    Thanks. I thought it was a good catchy phrase.



  7. #7
    ben
    Guest

    Re: Reference Libraries

    hmmm ok it compliles ok runs ok but it just doesn't mail
    anything................

    "Fredrik Wahlgren" wrote:

    >
    > "Bob Phillips" <[email protected]> wrote in message
    > news:uV2jWu%[email protected]...
    > > You are referring to late binding, which doesn't bind to the application
    > > type library at development/compile time, but makes multiple calls at
    > > runtime.
    > >
    > > Essentially, rather than setting a reference to the type library via
    > > Tools>References, and then declaring an object of type Outlook.Application
    > > or whatever, you create a generic Object variable and create that object
    > > rather than just New.
    > >
    > > You lose access to the application's object model and intellisens when you
    > > do this, but there is another way, what I call Develop Early, Release

    > Late.
    > > An example is given (using Outlook) at
    > > http://www.xldynamic.com/source/xld.EarlyLate.html
    > >
    > > --
    > >

    >
    > Develop Early, Release Late ? That sounds like something I want to
    > remember. Nice!
    >
    > /Fredrik
    >
    >
    >


  8. #8
    ben
    Guest

    Re: Reference Libraries

    nevermind, stupid me, the worst of all errors, syntax was incorrect for one
    variable. sigh. I really need finish changing this project to option
    explicit, thanks all

    "ben" wrote:

    > hmmm ok it compliles ok runs ok but it just doesn't mail
    > anything................
    >
    > "Fredrik Wahlgren" wrote:
    >
    > >
    > > "Bob Phillips" <[email protected]> wrote in message
    > > news:uV2jWu%[email protected]...
    > > > You are referring to late binding, which doesn't bind to the application
    > > > type library at development/compile time, but makes multiple calls at
    > > > runtime.
    > > >
    > > > Essentially, rather than setting a reference to the type library via
    > > > Tools>References, and then declaring an object of type Outlook.Application
    > > > or whatever, you create a generic Object variable and create that object
    > > > rather than just New.
    > > >
    > > > You lose access to the application's object model and intellisens when you
    > > > do this, but there is another way, what I call Develop Early, Release

    > > Late.
    > > > An example is given (using Outlook) at
    > > > http://www.xldynamic.com/source/xld.EarlyLate.html
    > > >
    > > > --
    > > >

    > >
    > > Develop Early, Release Late ? That sounds like something I want to
    > > remember. Nice!
    > >
    > > /Fredrik
    > >
    > >
    > >


  9. #9
    Fredrik Wahlgren
    Guest

    Re: Reference Libraries


    "ben" <[email protected](remove this if mailing direct)> wrote in message
    news:[email protected]...
    > hmmm ok it compliles ok runs ok but it just doesn't mail
    > anything................
    >


    Do you have an error handler in your code?

    /Fredrik



  10. #10
    Bob Phillips
    Guest

    Re: Reference Libraries

    You don't use Option Explicit all the time?

    You know you can set that in Tools>Options>Editor tab, Require Variable
    Declaration checkbox.

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "ben" <[email protected](remove this if mailing direct)> wrote in message
    news:[email protected]...
    > nevermind, stupid me, the worst of all errors, syntax was incorrect for

    one
    > variable. sigh. I really need finish changing this project to option
    > explicit, thanks all
    >
    > "ben" wrote:
    >
    > > hmmm ok it compliles ok runs ok but it just doesn't mail
    > > anything................
    > >
    > > "Fredrik Wahlgren" wrote:
    > >
    > > >
    > > > "Bob Phillips" <[email protected]> wrote in message
    > > > news:uV2jWu%[email protected]...
    > > > > You are referring to late binding, which doesn't bind to the

    application
    > > > > type library at development/compile time, but makes multiple calls

    at
    > > > > runtime.
    > > > >
    > > > > Essentially, rather than setting a reference to the type library via
    > > > > Tools>References, and then declaring an object of type

    Outlook.Application
    > > > > or whatever, you create a generic Object variable and create that

    object
    > > > > rather than just New.
    > > > >
    > > > > You lose access to the application's object model and intellisens

    when you
    > > > > do this, but there is another way, what I call Develop Early,

    Release
    > > > Late.
    > > > > An example is given (using Outlook) at
    > > > > http://www.xldynamic.com/source/xld.EarlyLate.html
    > > > >
    > > > > --
    > > > >
    > > >
    > > > Develop Early, Release Late ? That sounds like something I want to
    > > > remember. Nice!
    > > >
    > > > /Fredrik
    > > >
    > > >
    > > >




+ 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