Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 60
Default Problem updating references

Hello,
I have a VB6/MS Office Excel/Word VBA app configured in Win XP Office 2003.
I am trying to make it compatible with earlier versions of Office-Office 97
on a Win 98 platform at present-and after researching have decided to try
late binding. According to MS documentation, the application should update
its references when opened in the earlier Office 97 version. It has done this
for 6 of 8 references: except for the MS Word reference-it is still looking
for Word 11.0 in the same location as was on the original, newer platform.
Then it is also looking for the MS VBA Extensibility 5.3 file in the location
of the original, newer platform as well.

Does anyone have an idea how I can get my app to point to the correct 2
references per above? Also should the Extensibility reference be to the newer
5.3 version (vbe6ext.olb) which per KB article 269116 is a replacement for
the earlier older type library (which I am guessing is vbeext1.olb as that is
what I find on my Office 97 platform);and if so 1) should I add that to my
installer application. 2) how do I get it to point to the correct location?
Will I need to use code to locate and set the reference to the file?
Thanks, blessings
Van

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default Problem updating references

This bit of code works with old Word libraries.
Not sure about the VBA Extensibility 5.3.

Sub ActivateWordLibrary()

Dim r

On Error Resume Next

'no need to carry on if the Word Object Library is already there
'---------------------------------------------------------------
For Each r In ThisWorkbook.VBProject.References
If r.GUID = "{00020905-0000-0000-C000-000000000046}" Then
Exit Sub
End If
Next

'Will this work with any Word version from 97 upwards?
'-----------------------------------------------------
'hopefully it will by doing Major:=0, Minor:=0
'Word 2002 is Major:=8, Minor:=2
'Word 2003 is Major:=8, Minor:=3
'-----------------------------------------------------
ThisWorkbook.VBProject.References.AddFromGuid _
GUID:="{00020905-0000-0000-C000-000000000046}", _
Major:=0, Minor:=0

On Error GoTo 0

End Sub

Note that this for an Excel .xla add-in and that is why it is ThisWorkbook
and not ActiveWorkbook.


RBS



"VanS" wrote in message
...
Hello,
I have a VB6/MS Office Excel/Word VBA app configured in Win XP Office
2003.
I am trying to make it compatible with earlier versions of Office-Office
97
on a Win 98 platform at present-and after researching have decided to try
late binding. According to MS documentation, the application should update
its references when opened in the earlier Office 97 version. It has done
this
for 6 of 8 references: except for the MS Word reference-it is still
looking
for Word 11.0 in the same location as was on the original, newer platform.
Then it is also looking for the MS VBA Extensibility 5.3 file in the
location
of the original, newer platform as well.

Does anyone have an idea how I can get my app to point to the correct 2
references per above? Also should the Extensibility reference be to the
newer
5.3 version (vbe6ext.olb) which per KB article 269116 is a replacement for
the earlier older type library (which I am guessing is vbeext1.olb as that
is
what I find on my Office 97 platform);and if so 1) should I add that to my
installer application. 2) how do I get it to point to the correct
location?
Will I need to use code to locate and set the reference to the file?
Thanks, blessings
Van


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 205
Default Problem updating references

Hi VanS,

I am trying to make it compatible with earlier versions of Office-Office 97
on a Win 98 platform at present-and after researching have decided to try
late binding.


To use late binding, you do the following:

1. Remove any references to the object models, in Project References
2. Declare all object variables that refer to the object models As Object
3. Replace any constants defined in those object models with their numeric
equivalents.
4. Use CreateObject("Appname") instead of 'New Appname' to create new
instances of the objects.

If you do that, you shouldn't have any references problems, as you won't have
any references!

Regards

Stephen Bullen
Microsoft MVP - Excel
www.oaltd.co.uk


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 60
Default Problem updating references

Thanks for your response, RB. God bless
Van

"RB Smissaert" wrote:

This bit of code works with old Word libraries.
Not sure about the VBA Extensibility 5.3.

Sub ActivateWordLibrary()

Dim r

On Error Resume Next

'no need to carry on if the Word Object Library is already there
'---------------------------------------------------------------
For Each r In ThisWorkbook.VBProject.References
If r.GUID = "{00020905-0000-0000-C000-000000000046}" Then
Exit Sub
End If
Next

'Will this work with any Word version from 97 upwards?
'-----------------------------------------------------
'hopefully it will by doing Major:=0, Minor:=0
'Word 2002 is Major:=8, Minor:=2
'Word 2003 is Major:=8, Minor:=3
'-----------------------------------------------------
ThisWorkbook.VBProject.References.AddFromGuid _
GUID:="{00020905-0000-0000-C000-000000000046}", _
Major:=0, Minor:=0

On Error GoTo 0

End Sub

Note that this for an Excel .xla add-in and that is why it is ThisWorkbook
and not ActiveWorkbook.


RBS



"VanS" wrote in message
...
Hello,
I have a VB6/MS Office Excel/Word VBA app configured in Win XP Office
2003.
I am trying to make it compatible with earlier versions of Office-Office
97
on a Win 98 platform at present-and after researching have decided to try
late binding. According to MS documentation, the application should update
its references when opened in the earlier Office 97 version. It has done
this
for 6 of 8 references: except for the MS Word reference-it is still
looking
for Word 11.0 in the same location as was on the original, newer platform.
Then it is also looking for the MS VBA Extensibility 5.3 file in the
location
of the original, newer platform as well.

Does anyone have an idea how I can get my app to point to the correct 2
references per above? Also should the Extensibility reference be to the
newer
5.3 version (vbe6ext.olb) which per KB article 269116 is a replacement for
the earlier older type library (which I am guessing is vbeext1.olb as that
is
what I find on my Office 97 platform);and if so 1) should I add that to my
installer application. 2) how do I get it to point to the correct
location?
Will I need to use code to locate and set the reference to the file?
Thanks, blessings
Van



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 60
Default Problem updating references

Thanks for your helpful response, Stephen. God bless
Van

"Stephen Bullen" wrote:

Hi VanS,

I am trying to make it compatible with earlier versions of Office-Office 97
on a Win 98 platform at present-and after researching have decided to try
late binding.


To use late binding, you do the following:

1. Remove any references to the object models, in Project References
2. Declare all object variables that refer to the object models As Object
3. Replace any constants defined in those object models with their numeric
equivalents.
4. Use CreateObject("Appname") instead of 'New Appname' to create new
instances of the objects.

If you do that, you shouldn't have any references problems, as you won't have
any references!

Regards

Stephen Bullen
Microsoft MVP - Excel
www.oaltd.co.uk





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 60
Default Problem updating references

Stephen,
I tried to remove the Office references as you suggested which I was able to
do for those from Office specifically, except for the Excel 11.0 Library-it
gave an error message that the file was in use. My application runs in Excel.
So do you have any suggestions on how I can get around this to remove this
reference?
Thanks
Van

"VanS" wrote:

Thanks for your helpful response, Stephen. God bless
Van

"Stephen Bullen" wrote:

Hi VanS,

I am trying to make it compatible with earlier versions of Office-Office 97
on a Win 98 platform at present-and after researching have decided to try
late binding.


To use late binding, you do the following:

1. Remove any references to the object models, in Project References
2. Declare all object variables that refer to the object models As Object
3. Replace any constants defined in those object models with their numeric
equivalents.
4. Use CreateObject("Appname") instead of 'New Appname' to create new
instances of the objects.

If you do that, you shouldn't have any references problems, as you won't have
any references!

Regards

Stephen Bullen
Microsoft MVP - Excel
www.oaltd.co.uk



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 205
Default Problem updating references

Hi VanS,

Yes, it is an Excel VBA project. One other
respondent suggested that I would only need to remove the Word references
which were the problem and shouldn't try to remove the Excel references. Do
you concur?


Yes. From your original post - "I have a VB6/MS Office Excel/Word VBA app" - I
thought this was a VB6 app.

Regards

Stephen Bullen
Microsoft MVP - Excel
www.oaltd.co.uk


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
Updating Absolute References Flipper Excel Worksheet Functions 1 December 18th 08 05:23 PM
Links/Cell References Not Updating ExHell Excel Worksheet Functions 0 April 25th 07 06:44 PM
Updating references in earlier versions VanS[_2_] Excel Programming 7 January 11th 05 04:47 PM
wraptext is not updating when using references to another cell Jurry Excel Programming 7 April 23rd 04 04:23 PM
Updating remote references. Darren[_5_] Excel Programming 2 August 13th 03 01:21 PM


All times are GMT +1. The time now is 10:16 PM.

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

About Us

"It's about Microsoft Excel"