I have a C# program that references a few things, namely Excel and office references. However, on the target machine, Office isn't installed. Is there a way to include the reference/dlls that the program needs in some sort of installation package so that it will work?
Here is the error code I get when I try to run it on someone's machine with Excel 2003. I installed the 2010 Interop from microsoft, but this still happened:
Thread failed to Initialize. System.IO.FileLoadException: Could not load file or assembly 'Microsoft.Office.Interop.Excel, Version=14.0.0.0, Culture=neutral,PublicKeyToken=71e9bce111e9429c' or one of its dependencies. The locaved assembly's manifest definition does not match the assembly reference. (Exception from HRESULT:0x80131040)
WRN: Assembly binding logging is turned OFF
It references this section when the error comes up, and despite being on another computer, it shows a path on my computer where the project is located.
private void bgwFirstProcessThread_DoWork(object sender, DoWorkEventArgs e)
{
try
{
BackgroundWorker worker;
worker = (BackgroundWorker)sender;
//Get the Class object and call the main method
XlsxThread WO = (XlsxThread)e.Argument;
WO.ProcessXlsx(worker, e);
}
catch (Exception ex)
{
MessageBox.Show("Thread failed to Initialize.\n" + ex.ToString());
}
}