我正在使用最后一列是16368地方numerarii表,在这种情况下,代码失败

我已经创build了一个类似的话题,我发现如何find最后一列。 随后的代码仅适用于less量的date。 我正在使用最后一列是16368位数的表格,在这种情况下,代码失败了。

//number of the last column int x = MatrixRange.Collumns.Count; //here I check to see what is the numbering column //(oddly enough, I get always the correct number, but the column the program does not issue textBox1.Text = x.ToString(); for (int Rnum = 6; Rnum <= MatrixRange.Cells.Count; Rnum++) { if ((MatrixRange.Cells[Rnum,x] as Excel.Range).Value2 != null) { //at this point the program will either ignore this function or shows an error, //if x = 10, not 16368, then the code works great string TabZeile = (MatrixRange.Cells[Rnum,x] as Eexcel.Range).Value2.ToString(); neuXml.Cells [Rnum,4] = TabZeile; } } 

这是因为Excel有限制 :

其中之一(你应该检查链接上面的其他人):

工作表大小1,048,576行16,384列