Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

interop.Excel.dll

Status
Not open for further replies.

dpdg

Programmer
May 23, 2005
148
US
I have a module in my app that creates Excel reports from a query agaist the database. I'm using interop.Excel.dll. It works fine in my testing on my development machine.

But after compiling I sent the new executable to my client and when she ran it it gave her the error message with something like:

'Can not find interop.Excel.dll'

So I sent her the dll and had her put it into the bin folder of the application and she ran it again and it still gave her the same error.

What do I need to have her do?
 
The machine on which the application is run must have Excel installed. I believe it has to be the same or later version as that on the development machine, as well.





I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson

Arrrr, mateys! Ye needs ta be preparin' yerselves fer Talk Like a Pirate Day! Ye has a choice: talk like a pira
 
jebenson is correct; you must have the same version as the client, or their version must be higher than yours.

Also, unless you did an XCopy of your program, or used the Debug portion of the program for a setup file, I don't think that the DLLs reside in the same directory. Your program would thusly be searching for it, probably in the Windows or WinNT directory.

Unless you know what version your client has (and yes, they must have Excel), you're better off using Excel as an object.

What I do is use the Interop DLL until I get all my coding done (because Intellisense saves a lot of time), and then delete the DLL from references and change it to an object. That way, if there is a version difference, it shouldn't matter.

I hope this helps.

Ron Repp

If gray hair is a sign of wisdom, then I'm a genius.
 
I don't understand Ron, what do you mean change it to an object? Doesn't it have to be an object in code to begin with?

Ok I delete the dll from the references -- understood

this is how my objects are defined:

Code:
      Dim app As New Microsoft.Office.Interop.Excel.Application
      Dim book As Microsoft.Office.Interop.Excel.Workbook
      Dim sheet As Microsoft.Office.Interop.Excel.Worksheet
      Dim range As Microsoft.Office.Interop.Excel.Range

Would I have to change this?
 
Dont forget to send the Interop.Excel.dll file to your client, too. Tell her to put it in the same directory of the EXE.
 
I did that and it still gave her the error

'Can not find interop.Excel.dll or one of its dependences'

I changed all the code to just use the Excel object, and it works fine on my machine. But on her machine it gets the same error that it can't find the interop.Excel.dll -- and I'm not even using it in my code.

The problem is that I can't get it out of the references. I've deleted it, but it just keeps coming back. And there is no project file that I can just go in and remove the lines that shouldn't be there.

I really need some help with this! My client is getting really peeved!
 
Ah - it looks like you are reading that wrong.

"Can not find Interop.Excel.dll or one of its dependencies."

You could be missing one of the dependencies could be missing from the client machine as well.

Here is a list of the dlls I include in one of my projects that leverages excel exporting (using the Excel.Application object):

Interop.Excel.dll
Interop.Microsoft.Office.Core.dll
Interop.Office.dll
Microsoft.Vbe.Interop.dll

Hope that helps.
 
Ok. I'm at my wits end!

I've tried everything. I wish that I'd never installed Office XP PIAs. I was doing fine automating Excel without it. The only this was I didn't have intellisense with it.

Finally I just went and installed it all on the client machine added these references to my project:

interop.Excel.dll
Vbe.Interop.dll
office.dll
stole.dll

and recompiled.

These are the files that, according to the readme that comes with the Office XP PIAs download from Microsoft.

Then I copied the new exe into the bin on the client's machine and BINGO! I still get the same error:
Code:
'File or Assembly name Interop.Excel or one of its dependencies was not found'

Please! I need any help I can get on this. If I don't get it fixed right away I may lose my job over it!

I really appreciate any help.

Thanks.

David
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top