LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.word.vba.general
external usenet poster
 
Posts: 118
Default Changing reference to Word in Excel project

I have an Excel project which calls Word (hence posting to both NG). It's
created on a system running Windows/Office XP. I've been having difficulty
running code which calls Word on Windows/Office 2000 machines. I discovered
the reference to the Word library was for Word10 - XP - which does not exist
on a 2000 machine. I got the bright idea of copying the Word9 reference
from a 2000 machine onto my XP machine, and then setting the reference in
the code which creates this workbook. With the following code, I have two
problems:

Sub Change_Refs()

' Set reference to Word9 vs. Word10
refWord9 = "C:\Program Files\Microsoft Office\Office10\MSWORD9.olb"
refWord10 = "C:\Program Files\Microsoft Office\Office10\MSWORD.olb"

ThisWorkbook.VBProject.References.Remove refWord10
ThisWorkbook.VBProject.References.AddFromFile refWord9

End Sub

Problem 1: The Remove line generates an error - "Object required"
Problem 2: I commented out the Remove line just to see what the code would
do on the Add line. Another error - I'm not trusted to programmatically
change the VB project.

Any suggestions?

Ed


 
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
Changing a word document into an excel spreadsheet aganchingco Excel Discussion (Misc queries) 7 October 26th 06 11:39 PM
Changing word case in Excel doc Brent Excel Discussion (Misc queries) 2 July 8th 05 09:03 PM
changing a Word doc to Excel Bob Excel Programming 1 April 23rd 04 09:55 PM
Changing project desktop icon Peter[_35_] Excel Programming 0 February 3rd 04 12:36 AM
how to remove a reference from Excel project? A J Excel Programming 0 October 23rd 03 05:11 PM


All times are GMT +1. The time now is 11:14 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"