HighTechTalks DotNet Forums  

Excel interop question

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


Discuss Excel interop question in the Dotnet Framework (Interop) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
=?Utf-8?B?UmVtaUBuZXdzZ3JvdXBzLm5vc3BhbQ==?=
 
Posts: n/a

Default Excel interop question - 09-04-2007 , 02:56 PM






I am develloping a .net application using excel automation. Me and my
colleague are having trouble with the excel reference. When i add the
reference and he does a get-latest, the excel reference is not found and the
app wont compile. If he add it again and i do a get latest i have the same
problem. we are running the same version of excel.

Now, i thought that this problem should be solved by referencing the office
PIA rather the COM object directly. I have yet to test that, but i'd like for
someone to comment on that approach.

Also, my dev environement is running Excel 2003 while production
environnement are running Excel 2002. So which PIA should i install and how
can i be sure that this will work on production...

Any feedback and comment on this will be appreciated.

Remi

Reply With Quote
  #2  
Old   
Doug Semler
 
Posts: n/a

Default Re: Excel interop question - 09-04-2007 , 03:35 PM






On Sep 4, 2:56 pm, R... (AT) newsgroups (DOT) nospam
<Reminewsgroupsnos... (AT) discussions (DOT) microsoft.com> wrote:
Quote:
I am develloping a .net application using excel automation. Me and my
colleague are having trouble with the excel reference. When i add the
reference and he does a get-latest, the excel reference is not found and the
app wont compile. If he add it again and i do a get latest i have the same
problem. we are running the same version of excel.

Now, i thought that this problem should be solved by referencing the office
PIA rather the COM object directly. I have yet to test that, but i'd like for
someone to comment on that approach.

Also, my dev environement is running Excel 2003 while production
environnement are running Excel 2002. So which PIA should i install and how
can i be sure that this will work on production...

Any feedback and comment on this will be appreciated.
I am assuming that by "get latest" you are referring to getting from
sourcesafe, right?

First (not to be flip but....) make sure that after you add the
reference you check in the project file? <g>

I wouldn't add the PIA directly. I would either add the COM reference
or use the toolbox to add through com. VS is "smart" enough to use
the PIAs when applicable.

That being said, I just added the Excel 11 COM object, and my project
now includes VBIDE, Microsoft.Office.Interop.Excel, and
Microsoft.Office.Core as references. All from the GAC.




Reply With Quote
  #3  
Old   
=?Utf-8?B?UmVtaUBuZXdzZ3JvdXBzLm5vc3BhbQ==?=
 
Posts: n/a

Default Re: Excel interop question - 09-04-2007 , 03:46 PM



Yes of course the reference was added prior to the check in.
Do you think my problem is caused by the missing PIA and that installing the
PIA will solve the problem?



"Doug Semler" wrote:

Quote:
On Sep 4, 2:56 pm, R... (AT) newsgroups (DOT) nospam
Reminewsgroupsnos... (AT) discussions (DOT) microsoft.com> wrote:
I am develloping a .net application using excel automation. Me and my
colleague are having trouble with the excel reference. When i add the
reference and he does a get-latest, the excel reference is not found and the
app wont compile. If he add it again and i do a get latest i have the same
problem. we are running the same version of excel.

Now, i thought that this problem should be solved by referencing the office
PIA rather the COM object directly. I have yet to test that, but i'd like for
someone to comment on that approach.

Also, my dev environement is running Excel 2003 while production
environnement are running Excel 2002. So which PIA should i install and how
can i be sure that this will work on production...

Any feedback and comment on this will be appreciated.

I am assuming that by "get latest" you are referring to getting from
sourcesafe, right?

First (not to be flip but....) make sure that after you add the
reference you check in the project file? <g

I wouldn't add the PIA directly. I would either add the COM reference
or use the toolbox to add through com. VS is "smart" enough to use
the PIAs when applicable.

That being said, I just added the Excel 11 COM object, and my project
now includes VBIDE, Microsoft.Office.Interop.Excel, and
Microsoft.Office.Core as references. All from the GAC.




Reply With Quote
  #4  
Old   
Doug Semler
 
Posts: n/a

Default Re: Excel interop question - 09-04-2007 , 04:00 PM



On Sep 4, 3:46 pm, R... (AT) newsgroups (DOT) nospam
<Reminewsgroupsnos... (AT) discussions (DOT) microsoft.com> wrote:
Quote:
Yes of course the reference was added prior to the check in.
Do you think my problem is caused by the missing PIA and that installing the
PIA will solve the problem?



"Doug Semler" wrote:
On Sep 4, 2:56 pm, R... (AT) newsgroups (DOT) nospam
Reminewsgroupsnos... (AT) discussions (DOT) microsoft.com> wrote:
I am develloping a .net application using excel automation. Me and my
colleague are having trouble with the excel reference. When i add the
reference and he does a get-latest, the excel reference is not found and the
app wont compile. If he add it again and i do a get latest i have the same
problem. we are running the same version of excel.

Now, i thought that this problem should be solved by referencing the office
PIA rather the COM object directly. I have yet to test that, but i'd like for
someone to comment on that approach.

Also, my dev environement is running Excel 2003 while production
environnement are running Excel 2002. So which PIA should i install and how
can i be sure that this will work on production...

Any feedback and comment on this will be appreciated.

I am assuming that by "get latest" you are referring to getting from
sourcesafe, right?

First (not to be flip but....) make sure that after you add the
reference you check in the project file? <g

I wouldn't add the PIA directly. I would either add the COM reference
or use the toolbox to add through com. VS is "smart" enough to use
the PIAs when applicable.

That being said, I just added the Excel 11 COM object, and my project
now includes VBIDE, Microsoft.Office.Interop.Excel, and
Microsoft.Office.Core as references. All from the GAC
What, exactly, do you mean by "missing PIA?" The PIAs should have
been installed when you installed both Office and VS2005, or are you
on VS 2K3?? Also, if you are adding a reference via the "Browse"
rather than from the GAC or COM object, you need to ensure that the
"browse to.." directory is exactly the same on both machines. You can
do this by either:
Mounting a network drive to the same location on all developer PCs
Using the same location on all PCs (local copy)
Including the required "3rd party" assemblies in a subdir of the
project and using that subdir (the subdir will be project relative in
this case).

Check your project file with notepad to see where the "hintpath" is
for the assembly. You may be surprised...



Reply With Quote
  #5  
Old   
=?Utf-8?B?UmVtaUBuZXdzZ3JvdXBzLm5vc3BhbQ==?=
 
Posts: n/a

Default Re: Excel interop question - 09-05-2007 , 02:40 PM



Doug,
from all your suggestion i picked the sub-directory and browse approach
which work perfectly in our case and should work well in deployment as well.

Also, prior to doing that, i checked and the reference we added trough the
COM tab did not resolved to the PIA but used the generated one in bin/debug/
directory. So my office PIA where not installed or something was wrong in the
resolution (at least its what i read on MSDN).

Nevertheless thanks a lot


"Doug Semler" wrote:

Quote:
On Sep 4, 3:46 pm, R... (AT) newsgroups (DOT) nospam
Reminewsgroupsnos... (AT) discussions (DOT) microsoft.com> wrote:
Yes of course the reference was added prior to the check in.
Do you think my problem is caused by the missing PIA and that installing the
PIA will solve the problem?



"Doug Semler" wrote:
On Sep 4, 2:56 pm, R... (AT) newsgroups (DOT) nospam
Reminewsgroupsnos... (AT) discussions (DOT) microsoft.com> wrote:
I am develloping a .net application using excel automation. Me and my
colleague are having trouble with the excel reference. When i add the
reference and he does a get-latest, the excel reference is not found and the
app wont compile. If he add it again and i do a get latest i have the same
problem. we are running the same version of excel.

Now, i thought that this problem should be solved by referencing the office
PIA rather the COM object directly. I have yet to test that, but i'd like for
someone to comment on that approach.

Also, my dev environement is running Excel 2003 while production
environnement are running Excel 2002. So which PIA should i install and how
can i be sure that this will work on production...

Any feedback and comment on this will be appreciated.

I am assuming that by "get latest" you are referring to getting from
sourcesafe, right?

First (not to be flip but....) make sure that after you add the
reference you check in the project file? <g

I wouldn't add the PIA directly. I would either add the COM reference
or use the toolbox to add through com. VS is "smart" enough to use
the PIAs when applicable.

That being said, I just added the Excel 11 COM object, and my project
now includes VBIDE, Microsoft.Office.Interop.Excel, and
Microsoft.Office.Core as references. All from the GAC

What, exactly, do you mean by "missing PIA?" The PIAs should have
been installed when you installed both Office and VS2005, or are you
on VS 2K3?? Also, if you are adding a reference via the "Browse"
rather than from the GAC or COM object, you need to ensure that the
"browse to.." directory is exactly the same on both machines. You can
do this by either:
Mounting a network drive to the same location on all developer PCs
Using the same location on all PCs (local copy)
Including the required "3rd party" assemblies in a subdir of the
project and using that subdir (the subdir will be project relative in
this case).

Check your project file with notepad to see where the "hintpath" is
for the assembly. You may be surprised...



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.