I have a WinForm that manipulates Excel files. Right now it's an .exe
that has a hardcoded file load or creation method (just for testing). I need to be able to open the .exe
via an Excel file, and then add that file (maybe as a sender through some event?) to the form for manipulation.
Below is an example of how I load the Excel file into the form right now.
public Excel.Application EXCEL_FILE;
public frmMain()
{
InitializeComponent();
this.EXCEL_FILE = new Excel.Application();
this.EXCEL_FILE.SheetSelectionChange += new Excel.AppEvents_SheetSelectionChangeEventHandler(activeCellChanged);
ExcelHandling.LoadExcelFile();
}
public static void LoadExcelFile()
{
frmMain._frmMain.EXCEL_FILE.Workbooks.Open(@"F:\dsa.xlsx", 0, false, 5, "", "", true, Excel.XlPlatform.xlWindows, "\t", false, false, 0, true, 1, 0);
frmMain._frmMain.EXCEL_FILE.Visible = true;
}
To summerize the workflow I need to establish is: Open some Excel file->call the WinForm (via add-in or something?)->Load the Excel file that called the WinForm into it.