HighTechTalks DotNet Forums  

Excel 2003 + 2007 on dev machine - deployment problems on Excel 2003machine

Dotnet Framework (Interop) microsoft.public.dotnet.framework.interop


Discuss Excel 2003 + 2007 on dev machine - deployment problems on Excel 2003machine in the Dotnet Framework (Interop) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
David Hearn
 
Posts: n/a

Default Excel 2003 + 2007 on dev machine - deployment problems on Excel 2003machine - 05-02-2007 , 07:42 AM






I'm writing a C# app which will populate an Excel spreadsheet. The app
references Excel using COM.

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

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

Assembly Microsoft.Office.Interop.Excel
C:\WINDOWS\assembly\GAC\Microsoft.Office.Interop.E xcel\12.0.0.0__71e9bce111e9429c\Microsoft.Office.I nterop.Excel.dll

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

It's saying it's Excel 11, but then references the Excel 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 2007 on
this machine, but need to be able to build for Excel 2003.

Thanks

David

Reply With Quote
  #2  
Old   
Bill F
 
Posts: n/a

Default Re: Excel 2003 + 2007 on dev machine - deployment problems on Excel 2003 machine - 05-02-2007 , 10:20 AM






I had the same issue. After some research and testing, I discovered that
one cannot develop a .Net application for Excel on a development machine
that has Office 2007 and have this application work on a computer that has
Office 2003. However, your development machine can have Office 2003 and
your application will work on machines with Office 2003 or Office 2007.
Consequently, I had to go back to a development machine with Office 2003.

CAUTION: as you will see in my post that follows this message, when I
uninstalled Office 2007 from my development machine and installed office
2003, I had big problems getting the application .exe to work. I'm still
trying to resolve this.

Bill


"David Hearn" <david.hearn (AT) newsgroup (DOT) nospam> wrote

Quote:
I'm writing a C# app which will populate an Excel spreadsheet. The app
references Excel using COM.

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

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

Assembly Microsoft.Office.Interop.Excel
C:\WINDOWS\assembly\GAC\Microsoft.Office.Interop.E xcel\12.0.0.0__71e9bce111e9429c\Microsoft.Office.I nterop.Excel.dll

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

It's saying it's Excel 11, but then references the Excel 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 2007 on this
machine, but need to be able to build for Excel 2003.

Thanks

David


Reply With Quote
  #3  
Old   
David Hearn
 
Posts: n/a

Default Re: Excel 2003 + 2007 on dev machine - deployment problems on Excel2003 machine - 05-02-2007 , 11:34 AM



From what I've been able to deduce, Office 2007 has redirects from
Office 11 PIAs to Office 12 PIAs because they 12/2007 ones are backward
compatible to 11/2003.

This means that whenever I add a reference to the Office 2003 Interop, I
actually (without warning) get redirected to the Office 2007 Iterop files.

This causes a problem as when you build it, it references the Office
2007 ones, and deploying onto a Office 2003 machine - it doesn't have
the Office 2007 ones.

Everything would be fine if my dev machine was Office 2003 and the
depoyment machines were 2003 or 2007.

The solution it seems is in your app.config file redirect the request
for v12 ones to v11.


<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Microsoft.Office.Interop.Excel"
publicKeyToken="71e9bce111e9429c"
culture="neutral" />
<publisherPolicy apply="yes" />
<bindingRedirect oldVersion="12.0.0.0"
newVersion="11.0.0.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

It's working for me with that as the main app.config file. The actual
app doesn't use the Excel part, but a DLL it references does, and it
seems that it's only the main app which needs this, not the DLL.

I'm also not sure whether this is a recommended way of doing it - but as
I said, works for me.

Hope that helps you.

David


Bill F wrote:
Quote:
I had the same issue. After some research and testing, I discovered
that one cannot develop a .Net application for Excel on a development
machine that has Office 2007 and have this application work on a
computer that has Office 2003. However, your development machine can
have Office 2003 and your application will work on machines with Office
2003 or Office 2007. Consequently, I had to go back to a development
machine with Office 2003.

CAUTION: as you will see in my post that follows this message, when I
uninstalled Office 2007 from my development machine and installed office
2003, I had big problems getting the application .exe to work. I'm
still trying to resolve this.

Bill


"David Hearn" <david.hearn (AT) newsgroup (DOT) nospam> wrote in message
news:%23ovnw7KjHHA.588 (AT) TK2MSFTNGP06 (DOT) phx.gbl...
I'm writing a C# app which will populate an Excel spreadsheet. The
app references Excel using COM.

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

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

Assembly Microsoft.Office.Interop.Excel
C:\WINDOWS\assembly\GAC\Microsoft.Office.Interop.E xcel\12.0.0.0__71e9bce111e9429c\Microsoft.Office.I nterop.Excel.dll


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


It's saying it's Excel 11, but then references the Excel 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 2007 on
this machine, but need to be able to build for Excel 2003.

Thanks

David


Reply With Quote
  #4  
Old   
Bill F
 
Posts: n/a

Default Re: Excel 2003 + 2007 on dev machine - deployment problems on Excel 2003 machine - 05-02-2007 , 08:01 PM



David:

So, let me see if I got this right. You build your application on a machine
with Office 2007 installed. When you deploy the application to a machine
with Office 2003, you include the app.config file you desribed below. When
you deploy your application to a machine with Office 2007, you don't include
the app.config because the redirect is not needed. Is this correct?

Getting Closer Bill
(maybe)

"David Hearn" <david.hearn (AT) newsgroup (DOT) nospam> wrote

Quote:
From what I've been able to deduce, Office 2007 has redirects from Office
11 PIAs to Office 12 PIAs because they 12/2007 ones are backward
compatible to 11/2003.

This means that whenever I add a reference to the Office 2003 Interop, I
actually (without warning) get redirected to the Office 2007 Iterop files.

This causes a problem as when you build it, it references the Office 2007
ones, and deploying onto a Office 2003 machine - it doesn't have the
Office 2007 ones.

Everything would be fine if my dev machine was Office 2003 and the
depoyment machines were 2003 or 2007.

The solution it seems is in your app.config file redirect the request for
v12 ones to v11.


?xml version="1.0" encoding="utf-8" ?
configuration
runtime
assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"
dependentAssembly
assemblyIdentity name="Microsoft.Office.Interop.Excel"
publicKeyToken="71e9bce111e9429c"
culture="neutral" /
publisherPolicy apply="yes" /
bindingRedirect oldVersion="12.0.0.0"
newVersion="11.0.0.0"/
/dependentAssembly
/assemblyBinding
/runtime
/configuration

It's working for me with that as the main app.config file. The actual app
doesn't use the Excel part, but a DLL it references does, and it seems
that it's only the main app which needs this, not the DLL.

I'm also not sure whether this is a recommended way of doing it - but as I
said, works for me.

Hope that helps you.

David


Bill F wrote:
I had the same issue. After some research and testing, I discovered that
one cannot develop a .Net application for Excel on a development machine
that has Office 2007 and have this application work on a computer that
has Office 2003. However, your development machine can have Office 2003
and your application will work on machines with Office 2003 or Office
2007. Consequently, I had to go back to a development machine with Office
2003.

CAUTION: as you will see in my post that follows this message, when I
uninstalled Office 2007 from my development machine and installed office
2003, I had big problems getting the application .exe to work. I'm still
trying to resolve this.

Bill


"David Hearn" <david.hearn (AT) newsgroup (DOT) nospam> wrote in message
news:%23ovnw7KjHHA.588 (AT) TK2MSFTNGP06 (DOT) phx.gbl...
I'm writing a C# app which will populate an Excel spreadsheet. The app
references Excel using COM.

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

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

Assembly Microsoft.Office.Interop.Excel
C:\WINDOWS\assembly\GAC\Microsoft.Office.Interop.E xcel\12.0.0.0__71e9bce111e9429c\Microsoft.Office.I nterop.Excel.dll

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

It's saying it's Excel 11, but then references the Excel 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 2007 on
this machine, but need to be able to build for Excel 2003.

Thanks

David



Reply With Quote
  #5  
Old   
Walter Wang [MSFT]
 
Posts: n/a

Default RE: Excel 2003 + 2007 on dev machine - deployment problems on Excel 2003 machine - 05-03-2007 , 02:29 AM



Hi David,

Looks like you've installed Office 2007's PIA (Primary Interop Assembly).
In VS2005, when you add a COM reference, it will try to check first if
there's any PIA registered for that COM component, if found, it will use
that PIA from GAC.

Please uninstall Office 2007's PIA and install Office 2003 PIA from here:

http://www.microsoft.com/downloads/d...83a-ac14-4125-
8ba0-d36d67e0f4ad&displaylang=en


For more information about PIA:

http://msdn2.microsoft.com/en-us/library/aa302338.aspx


Hope this helps.


Sincerely,
Walter Wang (wawang (AT) online (DOT) microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications. If you are using Outlook Express, please make sure you clear the
check box "Tools/Options/Read: Get 300 headers at a time" to see your reply
promptly.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.


Reply With Quote
  #6  
Old   
MissPing
 
Posts: n/a

Default RE: Excel 2003 + 2007 on dev machine - deployment problems on Exce - 05-03-2007 , 03:54 AM



Hi

I am so sorry for posting here, but I am unable to post a new question for
some reason. Please, please, please can you help me? I need to create a
trendline on my graph, and it is not letting me do it. Please help me, so
much rests on this!

Thank you so much in advance.

"Walter Wang [MSFT]" wrote:

Quote:
Hi David,

Looks like you've installed Office 2007's PIA (Primary Interop Assembly).
In VS2005, when you add a COM reference, it will try to check first if
there's any PIA registered for that COM component, if found, it will use
that PIA from GAC.

Please uninstall Office 2007's PIA and install Office 2003 PIA from here:

http://www.microsoft.com/downloads/d...83a-ac14-4125-
8ba0-d36d67e0f4ad&displaylang=en


For more information about PIA:

http://msdn2.microsoft.com/en-us/library/aa302338.aspx


Hope this helps.


Sincerely,
Walter Wang (wawang (AT) online (DOT) microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications. If you are using Outlook Express, please make sure you clear the
check box "Tools/Options/Read: Get 300 headers at a time" to see your reply
promptly.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.



Reply With Quote
  #7  
Old   
David Hearn
 
Posts: n/a

Default Re: Excel 2003 + 2007 on dev machine - deployment problems on Excel2003 machine - 05-03-2007 , 04:23 AM



Correct, that's what I've done. When I try it on my dev machine (with
the app.config and Office 2007 and Excel 2003 present) it works in just
the same way it seems - so I'm not 100% sure if you need to worry about
not deploying it to Office 2007 machines.

In my source folder and project I have an app.config file, when I build
it, it creates a <executablename.exe>.config file in the bin\Release and
bin\Debug folders containing the same information. It's that file (not
the one called app.config) that I'm deploying.

Hope that helps,

David

Bill F wrote:
Quote:
David:

So, let me see if I got this right. You build your application on a
machine with Office 2007 installed. When you deploy the application to
a machine with Office 2003, you include the app.config file you desribed
below. When you deploy your application to a machine with Office 2007,
you don't include the app.config because the redirect is not needed. Is
this correct?

Getting Closer Bill
(maybe)

"David Hearn" <david.hearn (AT) newsgroup (DOT) nospam> wrote in message
news:uSFDS9MjHHA.4596 (AT) TK2MSFTNGP05 (DOT) phx.gbl...
From what I've been able to deduce, Office 2007 has redirects from
Office 11 PIAs to Office 12 PIAs because they 12/2007 ones are
backward compatible to 11/2003.

This means that whenever I add a reference to the Office 2003 Interop,
I actually (without warning) get redirected to the Office 2007 Iterop
files.

This causes a problem as when you build it, it references the Office
2007 ones, and deploying onto a Office 2003 machine - it doesn't have
the Office 2007 ones.

Everything would be fine if my dev machine was Office 2003 and the
depoyment machines were 2003 or 2007.

The solution it seems is in your app.config file redirect the request
for v12 ones to v11.


?xml version="1.0" encoding="utf-8" ?
configuration
runtime
assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"
dependentAssembly
assemblyIdentity name="Microsoft.Office.Interop.Excel"
publicKeyToken="71e9bce111e9429c"
culture="neutral" /
publisherPolicy apply="yes" /
bindingRedirect oldVersion="12.0.0.0"
newVersion="11.0.0.0"/
/dependentAssembly
/assemblyBinding
/runtime
/configuration

It's working for me with that as the main app.config file. The actual
app doesn't use the Excel part, but a DLL it references does, and it
seems that it's only the main app which needs this, not the DLL.

I'm also not sure whether this is a recommended way of doing it - but
as I said, works for me.

Hope that helps you.

David


Bill F wrote:
I had the same issue. After some research and testing, I discovered
that one cannot develop a .Net application for Excel on a development
machine that has Office 2007 and have this application work on a
computer that has Office 2003. However, your development machine can
have Office 2003 and your application will work on machines with
Office 2003 or Office 2007. Consequently, I had to go back to a
development machine with Office 2003.

CAUTION: as you will see in my post that follows this message, when
I uninstalled Office 2007 from my development machine and installed
office 2003, I had big problems getting the application .exe to
work. I'm still trying to resolve this.

Bill


"David Hearn" <david.hearn (AT) newsgroup (DOT) nospam> wrote in message
news:%23ovnw7KjHHA.588 (AT) TK2MSFTNGP06 (DOT) phx.gbl...
I'm writing a C# app which will populate an Excel spreadsheet. The
app references Excel using COM.

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

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

Assembly Microsoft.Office.Interop.Excel
C:\WINDOWS\assembly\GAC\Microsoft.Office.Interop.E xcel\12.0.0.0__71e9bce111e9429c\Microsoft.Office.I nterop.Excel.dll


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


It's saying it's Excel 11, but then references the Excel 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 2007 on
this machine, but need to be able to build for Excel 2003.

Thanks

David



Reply With Quote
  #8  
Old   
David Hearn
 
Posts: n/a

Default Re: Excel 2003 + 2007 on dev machine - deployment problems on Excel2003 machine - 05-03-2007 , 04:33 AM



I had Office 2003 installed, and when I got Office 2007 I just did an
upgrade, so don't think I got to pick what got installed or not.

What I've gathered is that previously with Office 2003 and before the
PIAs weren't installed as default, causing issues with deployment of
apps which rely on them. In Office 2007 Microsoft have changed it so
that the PIAs get installed as default (which I guess happened here).

How should I uninstall the Office 2007 PIAs? Are they the the ".NET
Programmability Support" which is a per-application option which
describes itself as "Primary interop assembly that allows Microsoft
Office <product> programmability with .NET Framework version 1.1 or
greater".

Do I also need to remove the one called "Microsoft Forms 2.0 .NET
Programmability Support" which is a PIA for MS Forms 2.0?

Thanks

David

Walter Wang [MSFT] wrote:
Quote:
Hi David,

Looks like you've installed Office 2007's PIA (Primary Interop Assembly).
In VS2005, when you add a COM reference, it will try to check first if
there's any PIA registered for that COM component, if found, it will use
that PIA from GAC.

Please uninstall Office 2007's PIA and install Office 2003 PIA from here:

http://www.microsoft.com/downloads/d...83a-ac14-4125-
8ba0-d36d67e0f4ad&displaylang=en


For more information about PIA:

http://msdn2.microsoft.com/en-us/library/aa302338.aspx


Hope this helps.


Sincerely,
Walter Wang (wawang (AT) online (DOT) microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications. If you are using Outlook Express, please make sure you clear the
check box "Tools/Options/Read: Get 300 headers at a time" to see your reply
promptly.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.


Reply With Quote
  #9  
Old   
Bill F
 
Posts: n/a

Default Re: Excel 2003 + 2007 on dev machine - deployment problems on Excel 2003 machine - 05-03-2007 , 10:38 AM



David:

This could be the answer to my woes.

I am curious...how is it that you have Office 2007 AND Excel 2003 installed
on the same computer? I didn't think that was possible. Are both versions
of Interop.Excel on your development computer, i.e. Version 11.0 and 12.0?

If I go back the system with Office 2007 installed (I saved an image before
uninstalling Office 2007), I wonder if I can install Interop.Excel version
11.0 using the Office 2003 PIA installation O2003PIA.msi I downloaded from
Micrsoft.

Bill

"David Hearn" <david.hearn (AT) newsgroup (DOT) nospam> wrote

Quote:
Correct, that's what I've done. When I try it on my dev machine (with the
app.config and Office 2007 and Excel 2003 present) it works in just the
same way it seems - so I'm not 100% sure if you need to worry about not
deploying it to Office 2007 machines.

In my source folder and project I have an app.config file, when I build
it, it creates a <executablename.exe>.config file in the bin\Release and
bin\Debug folders containing the same information. It's that file (not
the one called app.config) that I'm deploying.

Hope that helps,

David

Bill F wrote:
David:

So, let me see if I got this right. You build your application on a
machine with Office 2007 installed. When you deploy the application to a
machine with Office 2003, you include the app.config file you desribed
below. When you deploy your application to a machine with Office 2007,
you don't include the app.config because the redirect is not needed. Is
this correct?

Getting Closer Bill
(maybe)

"David Hearn" <david.hearn (AT) newsgroup (DOT) nospam> wrote in message
news:uSFDS9MjHHA.4596 (AT) TK2MSFTNGP05 (DOT) phx.gbl...
From what I've been able to deduce, Office 2007 has redirects from
Office 11 PIAs to Office 12 PIAs because they 12/2007 ones are backward
compatible to 11/2003.

This means that whenever I add a reference to the Office 2003 Interop, I
actually (without warning) get redirected to the Office 2007 Iterop
files.

This causes a problem as when you build it, it references the Office
2007 ones, and deploying onto a Office 2003 machine - it doesn't have
the Office 2007 ones.

Everything would be fine if my dev machine was Office 2003 and the
depoyment machines were 2003 or 2007.

The solution it seems is in your app.config file redirect the request
for v12 ones to v11.


?xml version="1.0" encoding="utf-8" ?
configuration
runtime
assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"
dependentAssembly
assemblyIdentity name="Microsoft.Office.Interop.Excel"
publicKeyToken="71e9bce111e9429c"
culture="neutral" /
publisherPolicy apply="yes" /
bindingRedirect oldVersion="12.0.0.0"
newVersion="11.0.0.0"/
/dependentAssembly
/assemblyBinding
/runtime
/configuration

It's working for me with that as the main app.config file. The actual
app doesn't use the Excel part, but a DLL it references does, and it
seems that it's only the main app which needs this, not the DLL.

I'm also not sure whether this is a recommended way of doing it - but as
I said, works for me.

Hope that helps you.

David


Bill F wrote:
I had the same issue. After some research and testing, I discovered
that one cannot develop a .Net application for Excel on a development
machine that has Office 2007 and have this application work on a
computer that has Office 2003. However, your development machine can
have Office 2003 and your application will work on machines with Office
2003 or Office 2007. Consequently, I had to go back to a development
machine with Office 2003.

CAUTION: as you will see in my post that follows this message, when I
uninstalled Office 2007 from my development machine and installed
office 2003, I had big problems getting the application .exe to work.
I'm still trying to resolve this.

Bill


"David Hearn" <david.hearn (AT) newsgroup (DOT) nospam> wrote in message
news:%23ovnw7KjHHA.588 (AT) TK2MSFTNGP06 (DOT) phx.gbl...
I'm writing a C# app which will populate an Excel spreadsheet. The
app references Excel using COM.

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

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

Assembly Microsoft.Office.Interop.Excel
C:\WINDOWS\assembly\GAC\Microsoft.Office.Interop.E xcel\12.0.0.0__71e9bce111e9429c\Microsoft.Office.I nterop.Excel.dll

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

It's saying it's Excel 11, but then references the Excel 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 2007 on
this machine, but need to be able to build for Excel 2003.

Thanks

David




Reply With Quote
  #10  
Old   
Bill F
 
Posts: n/a

Default Re: Excel 2003 + 2007 on dev machine - deployment problems on Excel 2003 machine - 05-03-2007 , 10:40 AM



David:

This could be the answer to my woes.

I am curious...how is it that you have Office 2007 AND Excel 2003 installed
on the same computer? I didn't think that was possible. Are both versions
of Interop.Excel on your development computer, i.e. Version 11.0 and 12.0?

If I go back the system with Office 2007 installed (I saved an image before
uninstalling Office 2007), I wonder if I can install Interop.Excel version
11.0 using the Office 2003 PIA installation O2003PIA.msi I downloaded from
Micrsoft.

Bill

"David Hearn" <david.hearn (AT) newsgroup (DOT) nospam> wrote

Quote:
Correct, that's what I've done. When I try it on my dev machine (with the
app.config and Office 2007 and Excel 2003 present) it works in just the
same way it seems - so I'm not 100% sure if you need to worry about not
deploying it to Office 2007 machines.

In my source folder and project I have an app.config file, when I build
it, it creates a <executablename.exe>.config file in the bin\Release and
bin\Debug folders containing the same information. It's that file (not
the one called app.config) that I'm deploying.

Hope that helps,

David

Bill F wrote:
David:

So, let me see if I got this right. You build your application on a
machine with Office 2007 installed. When you deploy the application to a
machine with Office 2003, you include the app.config file you desribed
below. When you deploy your application to a machine with Office 2007,
you don't include the app.config because the redirect is not needed. Is
this correct?

Getting Closer Bill
(maybe)

"David Hearn" <david.hearn (AT) newsgroup (DOT) nospam> wrote in message
news:uSFDS9MjHHA.4596 (AT) TK2MSFTNGP05 (DOT) phx.gbl...
From what I've been able to deduce, Office 2007 has redirects from
Office 11 PIAs to Office 12 PIAs because they 12/2007 ones are backward
compatible to 11/2003.

This means that whenever I add a reference to the Office 2003 Interop, I
actually (without warning) get redirected to the Office 2007 Iterop
files.

This causes a problem as when you build it, it references the Office
2007 ones, and deploying onto a Office 2003 machine - it doesn't have
the Office 2007 ones.

Everything would be fine if my dev machine was Office 2003 and the
depoyment machines were 2003 or 2007.

The solution it seems is in your app.config file redirect the request
for v12 ones to v11.


?xml version="1.0" encoding="utf-8" ?
configuration
runtime
assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"
dependentAssembly
assemblyIdentity name="Microsoft.Office.Interop.Excel"
publicKeyToken="71e9bce111e9429c"
culture="neutral" /
publisherPolicy apply="yes" /
bindingRedirect oldVersion="12.0.0.0"
newVersion="11.0.0.0"/
/dependentAssembly
/assemblyBinding
/runtime
/configuration

It's working for me with that as the main app.config file. The actual
app doesn't use the Excel part, but a DLL it references does, and it
seems that it's only the main app which needs this, not the DLL.

I'm also not sure whether this is a recommended way of doing it - but as
I said, works for me.

Hope that helps you.

David


Bill F wrote:
I had the same issue. After some research and testing, I discovered
that one cannot develop a .Net application for Excel on a development
machine that has Office 2007 and have this application work on a
computer that has Office 2003. However, your development machine can
have Office 2003 and your application will work on machines with Office
2003 or Office 2007. Consequently, I had to go back to a development
machine with Office 2003.

CAUTION: as you will see in my post that follows this message, when I
uninstalled Office 2007 from my development machine and installed
office 2003, I had big problems getting the application .exe to work.
I'm still trying to resolve this.

Bill


"David Hearn" <david.hearn (AT) newsgroup (DOT) nospam> wrote in message
news:%23ovnw7KjHHA.588 (AT) TK2MSFTNGP06 (DOT) phx.gbl...
I'm writing a C# app which will populate an Excel spreadsheet. The
app references Excel using COM.

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

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

Assembly Microsoft.Office.Interop.Excel
C:\WINDOWS\assembly\GAC\Microsoft.Office.Interop.E xcel\12.0.0.0__71e9bce111e9429c\Microsoft.Office.I nterop.Excel.dll

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

It's saying it's Excel 11, but then references the Excel 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 2007 on
this machine, but need to be able to build for Excel 2003.

Thanks

David




Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.