Use of the Excel Interop in a .Net program

I have a .Net Windows forms program written many years ago, and I don't remember under which version of Visual Studio.  That program references the Excel interop.  My customer has it installed on a network drive.  To my surprise, the installation folder does not have the interop DLL.  I would have thought that years ago when I delivered the program I would have put that there.

Anyhow, they are moving to Win10 machines, still running this with a shortcut to a network drive.  One Win10 machine doesn't work, saying the DLL is not registered, while other Win10 machines work just fine.

I don't know what I'm looking for to try to resolve this.
Who is Participating?
Fernando SotoRetiredCommented:
To your statement, "I'm wondering if I should recompile the program with the latest Interop DLL and then redeploy.", the interop dll version must match the version for the Excel it was written for.

To your statement, "is the Interop DLL supposed to be in the program folder?", no it will look in the Global Assembly Cache, GAC, on the machine the program that uses it is run on.
Fernando SotoRetiredCommented:
Hi g_johnson;

On the Windows 10 machine that it does not work on do you have a copy of Excel having the same version as on the machines that it does work on installed? Not having Excel installed will cause this issue.
g_johnsonAuthor Commented:
Hi Fernando,

Yes, they have the same version of Office on all machines, though I will confirm that they did indeed install the Excel module when they installed office.

I'm wondering if I should recompile the program with the latest Interop DLL and then redeploy.  Do you think that could help?  Also, in theory, is the Interop DLL supposed to be in the program folder?
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Kyle AbrahamsSenior .Net DeveloperCommented:
Just a note to check the version of office installed vs the compiled dll.  I've run into problems where you have a 32 bit DLL and a 64 bit version of office or vice versa.
Fernando SotoRetiredCommented:
@g_johnson, as @Kyle stated that will also cause problems because if you built a 32 bit app and the Excel API is 64 bit the app will need the 32 bit dll to work and vice versa.
g_johnsonAuthor Commented:
We have not resolved this and have no idea what is wrong.  However, your comments were very helpful in eliminating possible sources of conflict.  Thank you.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.