我已经创建了一个类似的主题,我找到了如何找到最后一列。 后续代码仅适用于少量日期。我正在处理一个表,其中最后一列是 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;
}
}
最佳答案
关于c# - 我正在处理一个表,其中最后一列是 16368 位数字,在这种情况下,代码失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44180637/