By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,032 Members | 1,161 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,032 IT Pros & Developers. It's quick & easy.

Broken References

P: n/a
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.

Feb 15 '06 #1
Share this Question
Share on Google+
7 Replies


P: n/a
Could anyone provide any guidance?

Feb 15 '06 #2

P: n/a
"Bill Schanks" <ws******@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/de...dc_oxppias.asp

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

Feb 15 '06 #3

P: n/a
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.

Feb 15 '06 #4

P: n/a
"Bill Schanks" <ws******@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

Feb 16 '06 #5

P: n/a
"Bill Schanks" wrote in message
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
Feb 16 '06 #6

P: n/a
"Stan Smith" <ss****@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

Feb 16 '06 #7

P: n/a
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.

Feb 16 '06 #8

This discussion thread is closed

Replies have been disabled for this discussion.