As shown in title, lets say that I have two projects in one solution. I have three, the last one is just for an example. One project is ExcelWorkbook called (EWB)

and another one is WindowsForm called (Core). I would like to show/open/start this EWB from Core. I’ve added references to the first one:

and I can see sheets of that specific workbook. It’s not so easy as it is like when you’re showing form from another project. Just for note, EWB.Sheet1 does not contain a constructor that takes 0 arguments, its constructor has two argument, …
Here are these arguments:
- Microsoft.Office.Tools.Excel.Factory factory
- IServiceProvider serviceProvider
For this project its says as following:

I would like to open that workbook on button click event but I don’t know how to:
- start it
- show it
- open it
- or …
Any idea how this could be done? Any help will be appreciated!
This how I open form from another project, and this is the way I would like to open that EWB.
using WindowsFormsApplication1;
private void CoreBtn_Click(object sender, EventArgs e)
{
Form1 newForm = new Form1();
newForm.Show();
}
Add a reference to
Microsoft.Office.Interop.Excelandusing Excel = Microsoft.Office.Interop.Excel;Here is some simple code to get you started:
And for more information the Excel Object Model look here.