Solved

Word 2003 and 2007 COM problem

Posted on 2009-05-10
9
560 Views
Last Modified: 2013-11-27
I'm writing a VB.Net app which will populate an Word Document. The app references Word using COM.

I have Office 2003 and 2007 on my machine, but the machine which will be running the application will have Office 2003. Therefore, when I added the Word COM reference, I chose the Word 11 one.

Now that I'm trying the application on another machine I'm getting errors saying that the Microsoft.Office.Interop.Word version 12.0.0.0 is missing. Viewing the object browser I see that Microsoft.Office.Interop.Word is described as:

Assembly Microsoft.Office.Interop.Word
C:\WINDOWS\assembly\GAC\Microsoft.Office.Interop.Word\12.0.0.0__71e9bce111e9429c\Microsoft.Office.Interop.Word.dll

This is strange condisering in the Solution Explorer view, I see the properties for the Word Reference set to:
Microsoft.Office.Interop.Word
Microsoft Excel 11.0 Object Library
C:\WINDOWS\assembly\GAC\Microsoft.Office.Interop.Word\12.0.0.0__71e9bce111e9429c\Microsoft.Office.Interop.Word.dll

It's saying it's Word 11, but then references the Word 12 interop libraries. I've removed the reference and added it again and it's still the same.

Any suggestions as to how I fix this? I need to keep Office 2003 and 2007 on this machine, but need to be able to build for Word 2003.

Thanks
0
Comment
Question by:Amitava_Mukherjee
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
9 Comments
 
LVL 37

Expert Comment

by:Joanne M. Orzech
ID: 24357858
So in the VBE, you go to Tools, References - click on the problem reference and have you tried just browsing to the correct one?
0
 

Author Comment

by:Amitava_Mukherjee
ID: 24360874
Yes, though I select "Microsoft Word 11.0 Object Library", the path is shown as "C:\WINDOWS\assembly\GAC\Microsoft.Office.Interop.Word\12.0.0.0__71e9bce111e9429c" which is the Word 2007 office related dll.
0
 
LVL 37

Expert Comment

by:Joanne M. Orzech
ID: 24367893
Then browse to the right one.....yes?
0
Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

 

Author Comment

by:Amitava_Mukherjee
ID: 24394136
I selected the right one, the office 2003 dll but it refers office 2007 dll still
0
 
LVL 37

Accepted Solution

by:
Joanne M. Orzech earned 500 total points
ID: 24426027
How did you "select" it?

Have you tried unchecking the box next to the 2007 library?
0
 

Author Closing Comment

by:Amitava_Mukherjee
ID: 31580037
Thanx, problem solved, actually in developer PC if office 2003 and office 2007 both exists, .net always bind the higher version dll from GAC although user select the lower version dll, .net still refers the higher version dll by default at time of compilation. Removing the higher version office is the only solution.
0
 
LVL 37

Expert Comment

by:Joanne M. Orzech
ID: 24440791
Oh - well thank you for that.  I was not aware of that.
0
 
LVL 3

Expert Comment

by:saji1976
ID: 24449297
Hi,

In my case, I am using VS 2005 and have both MS Office 2003 and 2007 in my machine.  I am adding a Reference 'Microsoft.Office.Interop.Word or Excel 11.0.0.0' in my project, but the path is referred to c:\windows\assembly\GAC\12.0.0.0.. folder; because of which 2007 is initiated when the application is executed, but i wan Word/Excel 2003 to be opened.  Also my requirement is both 2003 and 2007 will present on the server where the application is running.

Please let me know how to resolve this issue?

Thanks.
0
 
LVL 37

Expert Comment

by:Joanne M. Orzech
ID: 24450842
This may help - it tells you how to set the default version of Office when multiple versions are installed... however, it only works for Word - not Excel.

http://pubs.logicalexpressions.com/pub0009/LPMArticle.asp?ID=762
0

Featured Post

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It is often necessary in this forum and others to illustrate Word fields as text with the field delimiters replaced with the curly brackets that the delimiters resemble when field codes are being displayed on the document. This means that the text c…
Using Word 2013, I was experiencing some incredible lag when typing.  Here's what worked for me....
This video walks the viewer through the process of creating Hyperlinks for the web and other documents. Select the "Insert" tab: Click "Hyperlink":  Type "http://" followed by a web address to reference a website or navigate to a document to ref…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question