My requirement is to open an excel file which is under Attachment folder. So I took the reference from here and used abatishchev answer for my requirement. So I tried that in my below code.
public void ExportExcel()
{
string str_lwpc_query = string.Empty;
str_lwpc_query = "select company_name 'COMPANY NAME',Deputed_Company_Name 'DEPUTED COMPANY NAME',emp_card_no 'EMP CODE',emp_name 'EMPLOYEE NAME',LWP,'' Remarks, " +
"Adj_Days Gain_Loss_LOP_Days, VAL_DAY LOP_Days_Desc, month, year from XXACL_EMP_INFO_LWP_OTDAYS_HRS_V " +
"where emp_type='C' and month = '3' and year = '2015' ";
DataTable Dt_lwpc = new DataTable();
Dt_lwpc = CF.ExecuteDT(str_lwpc_query);
DataSet DS_lwpc = new DataSet();
DS_lwpc.Tables.Add(Dt_lwpc);
DS_lwpc.Tables[0].TableName = "Employee loss of pay for consultant Details";
var directory = Server.MapPath("~/Attachment/");
ExcelLibrary.DataSetHelper.CreateWorkbook(directory + "Employee_lwpc_Details.xls", DS_lwpc);
Microsoft.Office.Interop.Excel.Application excel = new Microsoft.Office.Interop.Excel.Application();
ExcelLibrary.Office.Excel.Workbook wb = excel.Workbooks.Open(ExcelLibrary.DataSetHelper.CreateWorkbook(directory + "Employee_lwpc_Details.xls", DS_lwpc));
}
but I get error in the last line as
The best overloaded method match for Microsoft.Office.Interop.Excel.Workbooks.Open(string, object, object, object, ...........) has some invalid arguments
kindly suggest what is wrong