在下面的代码中,我有错误,因为索引超出了数组的范围。即使这个代码完成了正确地将单元格复制到列中..有没有人帮助我
string[] array = { "F3", "J3", "N3", "R3", "V3", "Z3", "AD3", "AH3", "AL3", "AP3" };
string[] arrayb={"C","G","K","O","S","W","AA","AE","AI","AM"};
int a1count = arrayb.Length;
int b = 0;
for ( int a=0; a<= a1count; a++)
{
Excel.Range sourceRange = xlWorkSheet.get_Range(array[a]);
Excel.Range destinationRange = xlWorkSheet.UsedRange.Columns[arrayb[b]];
sourceRange.Copy(Type.Missing);
destinationRange.PasteSpecial(Microsoft.Office.Interop.Excel.XlPasteType.xlPasteFormulas,
Microsoft.Office.Interop.Excel.XlPasteSpecialOperation.xlPasteSpecialOperationNone, false, false);
b++;
}