AutoFit optimization

This commit is contained in:
Serghei Cebotari 2024-11-14 22:44:22 +03:00
parent e1289aebbc
commit b18e573da4

View File

@ -56,9 +56,17 @@ internal class OcrTool : ITool
Range excelCell = app.ActiveSheet.Cells(currentCell.Row + row, Range excelCell = app.ActiveSheet.Cells(currentCell.Row + row,
currentCell.Column + column); currentCell.Column + column);
excelCell.Value2 = table[row, column]; excelCell.Value2 = table[row, column];
excelCell.EntireColumn.AutoFit();
excelCell.EntireRow.AutoFit();
} }
foreach (Range row in tableRange.Rows)
{
row.EntireRow.AutoFit();
}
foreach (Range column in tableRange.Columns)
{
column.EntireColumn.AutoFit();
}
app.ActiveSheet.Cells(currentCell.Row + rowCount + 1, currentCell.Column).Activate(); app.ActiveSheet.Cells(currentCell.Row + rowCount + 1, currentCell.Column).Activate();
} }
} }