G
GG
Have this code but does not delete right columns.
When I ran the folllowing code only columns 14, and 15 is deleted.Col 12
and 13 are still there.
Any ideas?
Thanks
for (int colDel = 12; colDel <= 15; colDel++)
{
columnDelete(ref objSheet,colDel);
}
private void columnDelete(ref Excel._Worksheet objSheet,int column)
{
Excel.Range objCols = objSheet.Columns;
Excel.Range objCol = (Excel.Range)objCols[column,Missing.Value];
objCol.Delete(Missing.Value);
releaseComObj(objCols);
releaseComObj(objCol);
}
When I ran the folllowing code only columns 14, and 15 is deleted.Col 12
and 13 are still there.
Any ideas?
Thanks
for (int colDel = 12; colDel <= 15; colDel++)
{
columnDelete(ref objSheet,colDel);
}
private void columnDelete(ref Excel._Worksheet objSheet,int column)
{
Excel.Range objCols = objSheet.Columns;
Excel.Range objCol = (Excel.Range)objCols[column,Missing.Value];
objCol.Delete(Missing.Value);
releaseComObj(objCols);
releaseComObj(objCol);
}