+ Reply to Thread
Results 1 to 4 of 4

Reference lost when newer version opens file

  1. #1
    Rob
    Guest

    Reference lost when newer version opens file

    I have a workbook that uses the Outlook 9 ilbrary. If someone opens the book
    using office 10 then the reference gets updated to Outlook 10, which is fine
    until I open it again in Office 9 and have to mannually tell it to look at
    the version 9 library. Is there an easy way to fix this?

    Thanks

    Rob

  2. #2
    Tom Ogilvy
    Guest

    Re: Reference lost when newer version opens file

    Possibly use late binding and not create a reference

    Update the reference with code

    --
    Regards,
    Tom Ogilvy


    "Rob" <[email protected]> wrote in message
    news:[email protected]...
    > I have a workbook that uses the Outlook 9 ilbrary. If someone opens the

    book
    > using office 10 then the reference gets updated to Outlook 10, which is

    fine
    > until I open it again in Office 9 and have to mannually tell it to look at
    > the version 9 library. Is there an easy way to fix this?
    >
    > Thanks
    >
    > Rob




  3. #3
    Rob
    Guest

    Re: Reference lost when newer version opens file

    Thank you Tom

    Here's the code if anyone's interested:

    Private Sub Workbook_Open()
    'delete existing Outlook reference
    Dim Reference
    For Each Reference In VBProject.References
    If Reference.Name = "Outlook" Then VBProject.References.Remove(Reference)
    Next
    'set the Version 9 outlook reference
    ' I copied the file from c:\Program Files\Microsoft Office\Office\ to a
    network drive
    VBProject.References.AddFromFile ("N:\VBA\MSOUTL9.OLB")
    End Sub




    "Tom Ogilvy" wrote:

    > Possibly use late binding and not create a reference
    >
    > Update the reference with code
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    >
    > "Rob" <[email protected]> wrote in message
    > news:[email protected]...
    > > I have a workbook that uses the Outlook 9 ilbrary. If someone opens the

    > book
    > > using office 10 then the reference gets updated to Outlook 10, which is

    > fine
    > > until I open it again in Office 9 and have to mannually tell it to look at
    > > the version 9 library. Is there an easy way to fix this?
    > >
    > > Thanks
    > >
    > > Rob

    >
    >
    >


  4. #4
    Dave Peterson
    Guest

    Re: Reference lost when newer version opens file

    You might want to look at the way **** Kusleika does it:
    http://www.*****-clicks.com/excel/olBinding.htm

    You may want to look at these links that Tom Ogilvy posted recently:

    Here are some more extensive references on binding:

    Use late binding - don't have a reference to excel.

    http://support.microsoft.com/default...b;EN-US;244167
    INFO: Writing Automation Clients for Multiple Office Versions

    http://support.microsoft.com/default...b;en-us;245115
    INFO: Using Early Binding and Late Binding in Automation

    http://support.microsoft.com/default...b;en-us;247579
    INFO: Use DISPID Binding to Automate Office Applications Whenever Possible

    ==
    I don't think Tom suggested what you used.


    Rob wrote:
    >
    > Thank you Tom
    >
    > Here's the code if anyone's interested:
    >
    > Private Sub Workbook_Open()
    > 'delete existing Outlook reference
    > Dim Reference
    > For Each Reference In VBProject.References
    > If Reference.Name = "Outlook" Then VBProject.References.Remove(Reference)
    > Next
    > 'set the Version 9 outlook reference
    > ' I copied the file from c:\Program Files\Microsoft Office\Office\ to a
    > network drive
    > VBProject.References.AddFromFile ("N:\VBA\MSOUTL9.OLB")
    > End Sub
    >
    > "Tom Ogilvy" wrote:
    >
    > > Possibly use late binding and not create a reference
    > >
    > > Update the reference with code
    > >
    > > --
    > > Regards,
    > > Tom Ogilvy
    > >
    > >
    > > "Rob" <[email protected]> wrote in message
    > > news:[email protected]...
    > > > I have a workbook that uses the Outlook 9 ilbrary. If someone opens the

    > > book
    > > > using office 10 then the reference gets updated to Outlook 10, which is

    > > fine
    > > > until I open it again in Office 9 and have to mannually tell it to look at
    > > > the version 9 library. Is there an easy way to fix this?
    > > >
    > > > Thanks
    > > >
    > > > Rob

    > >
    > >
    > >


    --

    Dave Peterson

+ 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