Exception from HRESULT: 0x800A03EC during Excel 2007 operation
-
2008년 7월 10일 목요일 오후 6:49Hello all,
I have a weird situation that I cannot figure out. The code below iterates through all of the worksheets in a workbook (Excel 2007) and takes the sheet name and a link to a particular cell on each sheet. On all my tests everything works perfectly, until the workbook has too many sheets (haven't figured out what the magic number is yet - 20 seems fine.) If there are too many sheets (at least, that is the only thing that I have isolated it down to) then I get an Exception from HRESULT: 0x800A03EC thrown. Any ideas on what is causing this and how to get around it?
Thanks!Excel.
Worksheet tmpSheet;
for(q=2; q<total;q++)
{
tmpSheet = (Excel.Worksheet)doc.Worksheets[q];tmpSheetname =
"='" + tmpSheet.Name + "'!D40";cell =
"B" + (q+8).ToString();SummarySheet.get_Range(cell, cell).Value2 = tmpSheetname;
cell =
"A" + (q + 8).ToString();SummarySheet.get_Range(cell, cell).Value2 = tmpSheet.get_Range(
"D9", "D9").Value2.ToString().Remove(0, 15);}
- 이동됨 David DoBell 2008년 7월 10일 목요일 오후 8:59 Post is not related to Microsoft Interoperability
모든 응답
-
2012년 6월 15일 금요일 오전 5:56Replace("=","");后运行正常,特记录下来。
I like I DO 微软技术的忠实拥护者大麦 MSN: hesoft@hotmail.com ~~


