none
got error when i try to save excell Through my C# program

    Question

  • hi

    i have this code:

      Microsoft.Office.Interop.Excel.Application xlaC = new Microsoft.Office.Interop.Excel.Application();
                xlaC.Visible = false; 
                Workbook wbC = xlaC.Workbooks.Add(XlSheetType.xlWorksheet);
                Worksheet wsC = (Worksheet)xlaC.ActiveSheet;
                int i = 1;
                foreach (DataRow comp in dsView.Tables[0].Rows)
                {
                    wsC.Cells[i, 1] = comp[0].ToString();
                    wsC.Cells[i, 2] = "0";
                    wsC.Cells[i, 3] = comp[1].ToString();
                    i++;
                }
                xlaC.Save(@"d:\DDD.xlsx");

    and i got error on   xlaC.Save(@"d:\DDD.xlsx"); 

    the error: Exception from HRESULT: 0x800A03EC

    work on C# WinForm Visual-studio 2010 FrameWork 2.0

    Monday, October 07, 2013 6:13 AM

Answers