c# - Error 0x800A03EC when creating an excel data sheet -
iam trying create excel file info within datagridview db. following error exception hresult: 0x800a03ec" (system.runtime.interopservices.comexception)... error seems in line **
the code within button click
microsoft.office.interop.excel.application excel1 = new microsoft.office.interop.excel.application { }; workbook work1 = excel1.workbooks.add(xlsheettype.xlworksheet); worksheet ws1 = (worksheet)excel1.activesheet; excel1.visible = true; ws1.cells[1,1] = "id"; ws1.cells[1,2]= "name"; ** ws1.cells[1,1]= datagridview1[1,1]; ws1.cells[1, 2] = datagridview1[1,2];
there references available, example see:
com exception diagnosing:
https://msdn.microsoft.com/en-us/library/af1y26ew(v=vs.80).aspx
depending upon operating system using, old excel file access bug:
"when working excel, better work ranges instead directly cells. reason cells using late binding , see com errors":
when setting cells not work:
and lastly...
these few at.
Comments
Post a Comment