Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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" wrote in message ... 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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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" wrote in message ... 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
Posted to microsoft.public.excel.programming
|
|||
|
|||
Reference lost when newer version opens file
You might want to look at the way Dick Kusleika does it:
http://www.dicks-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" wrote in message ... 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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Saving a newer version of Excel using an older version (Excel 97) | Excel Discussion (Misc queries) | |||
opening newer version of excel program | Excel Discussion (Misc queries) | |||
opening newer version of excel | Excel Discussion (Misc queries) | |||
Macro won't run in the newer version | Excel Discussion (Misc queries) | |||
Can't find features in newer version | Excel Discussion (Misc queries) |