// Resize the columns oRange = oSheet.get_Range(oSheet.Cells[1, 1], oSheet.Cells[rowCount, dtFinal.Columns.Count]); oRange.EntireColumn.AutoFit();
get_range(oSheet.Cells[1,1]
try/catch
try { oRange = oSheet.get_Range(oSheet.Cells[1, 1], oSheet.Cells[rowCount, dtFinal.Columns.Count]); oRange.EntireColumn.AutoFit(); } catch (Exception ex) { // put a breakpoint here, and when your code throws the exception, inspect "ex" }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)