Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 101
Default Reference Library Upgrading

Is there any way to stop Excel 2007 from upgrading reference libraries? I
know probably not but I am getting fed up with the knowledge that I cannot
utilize the MS Outlook library in any sheets that may be used by both 2003
and 2007 (Currently we have both where I work, which is HIGHLY annoying).

To explain, if I create a sheet in 2003, I can add MS Outlook Lib 11.0. If a
2007 person opens it, it permanently upgrades to library to 12.0. Then if a
2003 opens the sheet, the code fails and the reference needs to be reset.
This is what I want to stop. It's especially bad with shared sheets as it
causes a fatal corruption in the file, since the library is still updated
even if the sheet is shared. VBA gets stripped out in order to recover it in
2003.

So any solutions out there?

--
*********************
J Streger
MS Office Master 2000 ed.
MS Project White Belt 2003

User of MS Office 2003

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Reference Library Upgrading

Instead of referencing; use CreateObject function which creates and returns
a reference to an Automation object

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

http://msdn.microsoft.com/en-us/libr...7z(VS.85).aspx

If this post helps click Yes
---------------
Jacob Skaria


"J Streger" wrote:

Is there any way to stop Excel 2007 from upgrading reference libraries? I
know probably not but I am getting fed up with the knowledge that I cannot
utilize the MS Outlook library in any sheets that may be used by both 2003
and 2007 (Currently we have both where I work, which is HIGHLY annoying).

To explain, if I create a sheet in 2003, I can add MS Outlook Lib 11.0. If a
2007 person opens it, it permanently upgrades to library to 12.0. Then if a
2003 opens the sheet, the code fails and the reference needs to be reset.
This is what I want to stop. It's especially bad with shared sheets as it
causes a fatal corruption in the file, since the library is still updated
even if the sheet is shared. VBA gets stripped out in order to recover it in
2003.

So any solutions out there?

--
*********************
J Streger
MS Office Master 2000 ed.
MS Project White Belt 2003

User of MS Office 2003

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 75
Default Reference Library Upgrading

Your answer is perfectly good, providing that you don't need to hook into an
Outlook event. I cannot seem to find any sample code which describes how one
would, for example, act upon an ItemSend event when you have late-bound your
Outlook Application object.

--
Alan Moseley IT Consultancy
http://www.amitc.co.uk

If I have solved your problem, please click Yes below. Thanks.


"Jacob Skaria" wrote:

Instead of referencing; use CreateObject function which creates and returns
a reference to an Automation object

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

http://msdn.microsoft.com/en-us/libr...7z(VS.85).aspx

If this post helps click Yes
---------------
Jacob Skaria


"J Streger" wrote:

Is there any way to stop Excel 2007 from upgrading reference libraries? I
know probably not but I am getting fed up with the knowledge that I cannot
utilize the MS Outlook library in any sheets that may be used by both 2003
and 2007 (Currently we have both where I work, which is HIGHLY annoying).

To explain, if I create a sheet in 2003, I can add MS Outlook Lib 11.0. If a
2007 person opens it, it permanently upgrades to library to 12.0. Then if a
2003 opens the sheet, the code fails and the reference needs to be reset.
This is what I want to stop. It's especially bad with shared sheets as it
causes a fatal corruption in the file, since the library is still updated
even if the sheet is shared. VBA gets stripped out in order to recover it in
2003.

So any solutions out there?

--
*********************
J Streger
MS Office Master 2000 ed.
MS Project White Belt 2003

User of MS Office 2003

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 101
Default Reference Library Upgrading

Thanks. I always try to avoid late binding application objects as it's so
much more elegant to tie in the reference, but in this case I can see the
benefit. Thanks.

--
*********************
J Streger
MS Office Master 2000 ed.
MS Project White Belt 2003

User of MS Office 2003



"Jacob Skaria" wrote:

Instead of referencing; use CreateObject function which creates and returns
a reference to an Automation object

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

http://msdn.microsoft.com/en-us/libr...7z(VS.85).aspx

If this post helps click Yes
---------------
Jacob Skaria


"J Streger" wrote:

Is there any way to stop Excel 2007 from upgrading reference libraries? I
know probably not but I am getting fed up with the knowledge that I cannot
utilize the MS Outlook library in any sheets that may be used by both 2003
and 2007 (Currently we have both where I work, which is HIGHLY annoying).

To explain, if I create a sheet in 2003, I can add MS Outlook Lib 11.0. If a
2007 person opens it, it permanently upgrades to library to 12.0. Then if a
2003 opens the sheet, the code fails and the reference needs to be reset.
This is what I want to stop. It's especially bad with shared sheets as it
causes a fatal corruption in the file, since the library is still updated
even if the sheet is shared. VBA gets stripped out in order to recover it in
2003.

So any solutions out there?

--
*********************
J Streger
MS Office Master 2000 ed.
MS Project White Belt 2003

User of MS Office 2003

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Reference Library Upgrading

As you say, to trap events you need to set a reference to the object
library. Typically such event code would be in an addin that would unlikely
be re-distributed. Providing you as the developer set the reference to the
lowest version of Outlook of any potential user there shouldn't be a
problem.

Developers tend to have multiple versions of Office and will normally have
an appropriate "old" version. However Outlook poses a problem as only be one
version of Outlook can be installed, typically of course that of the newest
version of Office on the system.

Unfortunately it can be difficult if not impossible to programmatically
remove a "too new" reference before replacing with a valid one. One
workaround might be to distribute the addin without the reference. In the
open event check some flag if the reference has been previously added, if
not add the reference and save a flag (hidden cell, registry etc). User must
have "Trust access to VB project allowed".

Regards,
Peter T

"Alan Moseley" wrote in message
...
Your answer is perfectly good, providing that you don't need to hook into
an
Outlook event. I cannot seem to find any sample code which describes how
one
would, for example, act upon an ItemSend event when you have late-bound
your
Outlook Application object.

--
Alan Moseley IT Consultancy
http://www.amitc.co.uk

If I have solved your problem, please click Yes below. Thanks.


"Jacob Skaria" wrote:

Instead of referencing; use CreateObject function which creates and
returns
a reference to an Automation object

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

http://msdn.microsoft.com/en-us/libr...7z(VS.85).aspx

If this post helps click Yes
---------------
Jacob Skaria


"J Streger" wrote:

Is there any way to stop Excel 2007 from upgrading reference libraries?
I
know probably not but I am getting fed up with the knowledge that I
cannot
utilize the MS Outlook library in any sheets that may be used by both
2003
and 2007 (Currently we have both where I work, which is HIGHLY
annoying).

To explain, if I create a sheet in 2003, I can add MS Outlook Lib 11.0.
If a
2007 person opens it, it permanently upgrades to library to 12.0. Then
if a
2003 opens the sheet, the code fails and the reference needs to be
reset.
This is what I want to stop. It's especially bad with shared sheets as
it
causes a fatal corruption in the file, since the library is still
updated
even if the sheet is shared. VBA gets stripped out in order to recover
it in
2003.

So any solutions out there?

--
*********************
J Streger
MS Office Master 2000 ed.
MS Project White Belt 2003

User of MS Office 2003



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
Upgrading to 2007 - Object library invalid Beans[_2_] Excel Programming 5 May 4th 09 03:57 AM
Excel - how to prevent new office version from upgrading word object reference Zoner Excel Programming 3 July 5th 06 07:04 PM
Reference to a library Nicolas Roth Excel Programming 1 April 11th 06 04:29 PM
Add-ins and Reference library Glen Mettler[_4_] Excel Programming 1 December 5th 04 11:41 AM
Reference Library - Missing Library in a lower version. luvgreen Excel Programming 1 October 7th 04 02:08 AM


All times are GMT +1. The time now is 05:15 PM.

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"