First of all I have have some codes which is filling some lists of strings, after that it puts all the lists in 1 big list. Now when I want to print those lists in my excel sheets, it stops after pint half of the first list, or stops after print 5 and a half list, and it says: Exception from HRESULT: 0x800AC472. There are already 30 tabs in the excel doc, so that is not the problem. Feel free to rename this title, Ihad no idea how to call this problem.
This is how I print my lists in excel:
for (int i = 0; i < ListofLists.Count; i++)
{
for (int j = 1; j <= ListofLists[i].Count; j++)
{
excelDataHandler.excel_setValue("A" + j, ListofLists[i][j-1], "", (i+1));
//A = cell, data of list, color of cell, sheetnumber
}
}
excel_setValue method:
public void excel_setValue(string cellname, string value, string color, int workSheet)
{
((Microsoft.Office.Interop.Excel._Worksheet)newWorkbook_First.Sheets[workSheet]).get_Range(cellname).set_Value(Type.Missing, value);
if (color == "red")
{
newSheets.get_Range(cellname).Interior.Color = System.Drawing.ColorTranslator.ToOle(System.Drawing.Color.Red);
}
}
I would appriciate any help with this problem. Thanks in asvance!
Here is my reflection code.