I am using C# Winforms and when I add a reference to the project for Microsoft.Interop.Office.Excel v12.0.0.0
, it automatically adds a COM reference to C:\Program Files\Microsoft Office\Office14\EXCEL.exe
.
This .exe
isn't found on any other machines, and as such, it won't work on other devices. Is there a way to import that file, or make it not reference to that file?
Any microsoft office tools like Microsoft.Office.Interof.Excel are part of Microsoft Primary Interop Assemblies called PIA, which can be downloaded separately and installed on production machine.
All version of PIAs can be downloaded from msdn. e.g. Office PIA
Msdn Pia link
Or you can copy them to Library Folder in your solution and reference these assembly from Library folder local to your solution.