References.

T

Tom

Hello,

I am using Office 2003 and I create some macro in excel. In this macro I am
using word application:

Set oWRDapp = CreateObject("WORD.Application")
Set oWRDdoc = oWRDapp.Documents
oWRDdoc.Add DocumentType:=0
....

Excel automaticly add refernces to "Microsoft Word 11.0 Object Libary". But
when I run this macro on computer where is install Office 2002 it dosnt work
because macro looking for Office 11. So i have to manualy change references
from Office10 to 10.

Do you know how can I correct this. Its possible do this change by macro?
Somethnig like:

if install office 2002 then referneces = Office10
if install office 2003 then referneces = Office11

Thanks Tom
 
B

Bob Phillips

Dim oWRDapp As Object


Set oWRDapp = CreateObject("WORD.Application")
Set oWRDdoc = oWRDapp.Documents
oWRDdoc.Add DocumentType:=0

and remove the refernce to Word, OR

develop code on the lower version of Excel

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
T

Tom

Thanks,
and how can I remove the refernce ?

Tom

Bob Phillips said:
Dim oWRDapp As Object


Set oWRDapp = CreateObject("WORD.Application")
Set oWRDdoc = oWRDapp.Documents
oWRDdoc.Add DocumentType:=0

and remove the refernce to Word, OR

develop code on the lower version of Excel

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
B

Bob Phillips

Go into Tools>References in the VBE, and uncheck that item.

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
T

Tom

Yes I know this. But how can I add references?
This dobt do it:
I have to do it manualy in refences tab.

tom
 
B

Bob Phillips

What? You asked how to remove a reference not add it.

--

HTH

RP
(remove nothere from the email address if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top