I developed an application that imports data in Microsoft Excel.
I am using VS2005 + .NET 2.0 and Microsoft Office 2007 is installed on my computer (Office 12).
The compiled application works fine if I run it on my machine, but when I deploy the application to other machines they say those that use lower versions (Office 2000), I get an error message:
Failed to load Microsoft.Office.Interop.Excel file or assembly version 12.0.0.0
How could I then turn on my application correctly, regardless of Office (Excel) installed on my computer?
Thanks.
Some updates: I placed two link DLLs, namely Microsoft.Office.Interop.Excel.dll (version 12.0.0.0) and office.dll (version 12.0.0.0) in my bin folder. I set the properties for this link to copy Local = True, and when I compile my application, the DLLs are copied to the debug / release folder.
Now, when I try to start the application, I already got out of this error: "Could not load the file or assembly Microsoft.Office.Interop.Excel, version 12.0.0.0"
but another error occurred: System.AccessViolationException: Attempted to read or write protected memory. This often indicates that another memory is corrupted. in Microsoft.Office.Interop.Excel.WorkbookClass.SaveAs (File object, FileFormat object, Password object, WriteResPassword object, ReadOnlyRecommended object, CreateBackup object, XlSaveAsAccessMode AccessMode, Conflict object, AddToMru object, TextCodepage object, TextVisualLayout object)
So, how can I create an application that could export data to Excel, regardless of the installed version of Office?
Thanks.