I have VB.NET and C# applications
I need to fill in some cells in existing Excel files or save some
results in new Excel files (not just text CSV files)
It works perfectly on my computer with MS Office installed
I included all references (as I think) to the project that will be
required for working with Excel files: Interop.Excel and
Interop.Microsoft.Office.Core
THE PROBLEM:
When I compile the project and install it anywhere else it does not
work, crashes with exceptions.
I need it to work on computers with no excel or with any other Excel
versions. That is why .NET requires us to include all necessary
assemblies and compile the project with them. Well, sounds good in
theory. Below is the exception that I am getting.
How can I make my installation work on nay computer regardless of the
existence of Excel (or its version if it is installed) on any other
computer.
Thank you.
System.NullReferenceException: Object reference not set to an instance
of an object.
at .....btnMakeExcel_Click(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons
button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg,
IntPtr wparam, IntPtr lparam)
************** Loaded Assemblies
Here goes a list of all loaded assemblies... |