Is it possible to create an excel file and open it, without saving it first to server or local location. I'm trying to acheive this.
using Microsoft.Office.Interop;
using Excel = Microsoft.Office.Interop.Excel;
protected void btnOpen_Click(object sender, EventArgs e)
{
OpenExcel();
}
private void OpenExcel()
{
Excel.Application app = new Excel.Application();
Excel.Workbook wb = new Excel.Workbook();
Excel.Worksheet ws = new Excel.Worksheet();
Excel.Range range = null;
app.visible = true;
wb = app.Workbooks.Add(1);
ws = wb.WorkSheets[1];
range = ws.get_Range("A1","A3");
ws.Cells[0,0]="Date";
ws.Cells[0,1]="Code";
ws.Cells[0,2]="Name";
}
Yes, the code is very much incomplete. The idea is to pop up an excel sheet (of certain template), to the user on button click. Could someone guide me, how I should proceed from here.