Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default adding reference to the Word-Library

Hi,

For an application i'm wirting in Excel (VBA) I will open a template in Word and add information to that template from within my Excel-sheet.

I've discovered that I need a reference for that to the Word-Library. (Tools - References - etc...)

The problem is that when someone tries to run the application on a computer that doesn't have that reference enabled, the code doesn't work...

Does anyone know how to check whetter the reference is made or not and, -if not- how to enable it?

Greets

Guido van Gemerden

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 56
Default adding reference to the Word-Library

Hi Guido
Please note file name reference differs according to office version
installed (code below works with Office xp and 2003)
On Error Resume Next
MyRef = ThisWorkbook.VBProject.References("Word").Descript ion
If Err < 0 Then
ThisWorkbook.VBProject.References.AddFromFile (Application.Path &
"\MSWORD.OLB")
End If
HTH
Regards
Pascal

"Guido van Gemerden" <Guido van a écrit
dans le message de
...
Hi,

For an application i'm wirting in Excel (VBA) I will open a template in

Word and add information to that template from within my Excel-sheet.

I've discovered that I need a reference for that to the Word-Library.

(Tools - References - etc...)

The problem is that when someone tries to run the application on a

computer that doesn't have that reference enabled, the code doesn't work...

Does anyone know how to check whetter the reference is made or not

and, -if not- how to enable it?

Greets

Guido van Gemerden



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
Naming word tables or coding reference library with vba hornbecky83 Charts and Charting in Excel 6 January 21st 07 01:11 AM
Reference Library Kevin Wickersheim Excel Programming 2 May 5th 04 08:18 PM
programmatically Set Reference to Library Todd uttenstine Excel Programming 6 April 30th 04 10:55 AM
Library Reference files Cindy Excel Programming 4 April 2nd 04 04:42 PM
Setting up Reference Library using VBA Alan Excel Programming 1 November 5th 03 03:18 AM


All times are GMT +1. The time now is 05:26 AM.

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"