Upgrading to Office 2007 causes VS 2005 app not to compile

R

Refresher

First, my apologies in advance if this is the wrong forum for this question.

Secondly, sorry for the lengthy post, but I need it to get my point across.



I have a .NET application that uses COM Interop to access the Excel and
PowerPoint APIs to do some automation. The application was originally
developed using VS 2005 and Office 2003. Here are the key assembly references
I had:



Microsoft.Office.Core
Excel
So, now my IT department is about to upgrade the organization to Office
2007. So I am now charged to make sure our app works with it. To my dismay,
but not so much to my surprise, after I upgraded to Office 2007, the app will
not compile anymore.



The Excel assembly reference seemed to have upgraded OK from the Microsoft
Excel 11.0 Object Library because when I click on the properties for the
reference now, I see in the Description:



Microsoft Excel 12.0 Object Library



But, I have a warning with my reference to Microsoft.Office.Core where it
says:



The referenced component 'Microsoft.Office.Core' could not be found.


I can get around this by removing the reference, then going to Add
References/COM and choosing the Microsoft Office 12.0 Object Library. This
warning goes away. But other mysterious warnings remain:



There are updated custom wrappers available for the following referenced
components: Excel ,PowerPoint.
Namespace or type specified in the Imports 'Microsoft.Office.Core' doesn't
contain any public member or cannot be found. Make sure the namespace or the
type is defined and contains at least one public member. Make sure the
imported element name doesn't use any aliases.

I am not quite sure how to get around these yet.



Also, somewhat related is in the VS2005/Office 2003 version of the app, I
could have the following:



using Excel;



But now with VS2005/Office 2007, it seems I have to do the following:



using Excel=Microsoft.Office.Interop.Excel;



If I don't make the change, I am getting errors like:



Type 'Excel.Application' is not defined.



Why? What is going on in Office 2007 that required this?



------



One final big issue I am having is the following:



We have our app in source control. My teammate is still maintaining the
VS2005/Office 2003 version of the code until Office 2007 is officially rolled
out. But, as seen here I am having to make changes required for Office 2007.
Now, I can handle the in-code changes by using conditional compilation, etc.
However, how can my teammate and I remain on the same code base given that we
have different assembly references (e.g. Microsoft Office 11.0 Object Library
vs. Microsoft Office 12.0 Object Library)? We would prefer not to have to
branch the entire source tree because we don't know how long we would have to
duplicate any fixes for -- it could become cumbersome. Any advice? Is there a
way just to branch the part of the VS2005 solution that references the
assemblies or something?



Thanks for any advice here.
 

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