Home All Groups Group Topic Archive Search About
Author
15 Feb 2006 3:37 PM
Bill Schanks
I created an Excel Automation Windows Application (VB.Net 2003) and it
works on the development machine fine.

However when I run it on another machine I get this error:

System.IO.FileNotFoundException: File or assembly name
Microsoft.Office.Interop.Excel, or one of its dependencies, was not
found.

File name: "Microsoft.Office.Interop.Excel"

Both machines have Excel 2003 installed, and I have a reference set to
Excel 11.0.

Author
15 Feb 2006 8:37 PM
Bill Schanks
Could anyone provide any guidance?
Author
15 Feb 2006 9:57 PM
Armin Zingler
Show quote Hide quote
"Bill Schanks" <wscha***@gmail.com> schrieb
> I created an Excel Automation Windows Application (VB.Net 2003) and
> it works on the development machine fine.
>
> However when I run it on another machine I get this error:
>
> System.IO.FileNotFoundException: File or assembly name
> Microsoft.Office.Interop.Excel, or one of its dependencies, was not
> found.
>
> File name: "Microsoft.Office.Interop.Excel"
>
> Both machines have Excel 2003 installed, and I have a reference set
> to Excel 11.0.


Is the file mentioned there?

I've never done it and didn't read it completely, but this might help:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnoxpta/html/odc_oxppias.asp

If not, search for "PIA" (primary interop assemblies) and "deploy".


Armin
Author
15 Feb 2006 11:02 PM
Bill Schanks
It seems like too much to have the end users having to install the PIA.

In my project I don't have 'Imports Microsoft.Office.Core'. I just have
a reference set to Excel 11.0. I will add it to see if that solves the
problem.

What started me on this project was some sample code from MS on excel
automation. In there the code was:

dim xlApp as new excel.application

I had to make it:

dim xlApp as new Microsoft.Office.Interop.Excel.Application().

Shouldn't excel.application work? I'm fine using the fully qualified
name it just seems like sample code should work once the references are
correctly set.
Author
15 Feb 2006 11:57 PM
Armin Zingler
"Bill Schanks" <wscha***@gmail.com> schrieb
> It seems like too much to have the end users having to install the
> PIA.

You're using them in the project, thus you will need them. (maybe there are
exceptions I haven't heard of (see
microsoft.public.dotnet.framework.interop))

> In my project I don't have 'Imports Microsoft.Office.Core'. I just
> have a reference set to Excel 11.0. I will add it to see if that
> solves the problem.

Importing a namespace doesn't solve it. It only saves you from typing the
full qualified name in the code.

> What started me on this project was some sample code from MS on
> excel automation. In there the code was:
>
> dim xlApp as new excel.application
>
> I had to make it:
>
> dim xlApp as new Microsoft.Office.Interop.Excel.Application().
>
> Shouldn't excel.application work? I'm fine using the fully qualified
> name it just seems like sample code should work once the references
> are correctly set.

If you import Microsoft.Office.Interop at project level or file level, you
don't have to type the FQN. That's what they probably assumed in the sample
code.


Armin
Author
16 Feb 2006 6:10 AM
Stan Smith
"Bill Schanks" wrote in message

Show quoteHide quote
>I created an Excel Automation Windows Application (VB.Net 2003) and it
> works on the development machine fine.
>
> However when I run it on another machine I get this error:
>
> System.IO.FileNotFoundException: File or assembly name
> Microsoft.Office.Interop.Excel, or one of its dependencies, was not
> found.
>
> File name: "Microsoft.Office.Interop.Excel"
>
> Both machines have Excel 2003 installed, and I have a reference set to
> Excel 11.0.
>

Bill,

I think you just need to put the file interop.excel.dll in the same folder
with your executable.  That's probably the file that is missing.

You can rewrite the program to use late binding and then it wouldn't be
necessary.

Stan

--
Stan Smith
ADS Programming Services
Birmingham, AL
205-222-1661
ssmith_at_adsprogramming.com
Author
16 Feb 2006 10:27 AM
Armin Zingler
"Stan Smith" <ssm***@adsprogramming.com> schrieb
> I think you just need to put the file interop.excel.dll in the same
> folder with your executable.  That's probably the file that is
> missing.


He doesn't want to install the interop PIA. ("It seems like too much to have
the end users having to install the PIA.") I wrote that this is necessary to
run the app.


Armin
Author
16 Feb 2006 5:06 PM
Bill Schanks
Thanks everyone for the help, sorry for the noob questions. I am maily
a vba programmer and I am making the switch to vb.net so I can write
stand alone apps.

I created an installer and it copies the proper .dll files. There is no
need to install the PIA's if the proper .dll file is in the same
directory as the application.

Thanks again for the guidance.