Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Rob Rob is offline
external usenet poster
 
Posts: 718
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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   Report Post  
Posted to microsoft.public.excel.programming
Rob Rob is offline
external usenet poster
 
Posts: 718
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Saving a newer version of Excel using an older version (Excel 97) Alain Dekker Excel Discussion (Misc queries) 7 April 3rd 10 11:02 PM
opening newer version of excel program serg c Excel Discussion (Misc queries) 2 November 12th 08 09:02 PM
opening newer version of excel serg c Excel Discussion (Misc queries) 2 November 12th 08 08:55 PM
Macro won't run in the newer version TC Excel Discussion (Misc queries) 4 August 1st 07 10:54 PM
Can't find features in newer version pdgood Excel Discussion (Misc queries) 1 February 21st 06 02:59 PM


All times are GMT +1. The time now is 10:48 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"