aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSerghei Cebotari <serghei@cebotari.ru>2024-11-14 22:44:22 +0300
committerSerghei Cebotari <serghei@cebotari.ru>2024-11-14 22:44:22 +0300
commitb18e573da4e007bab893edb8adf94219299eed4e (patch)
tree88b6ecc6addb1c74c38bec6b5dacf71fc605f871
parente1289aebbc2cd3b2a125e910f48a8cb695997d24 (diff)
AutoFit optimization
-rw-r--r--RhSolutions.AddIn/Tools/OcrTool.cs14
1 files changed, 11 insertions, 3 deletions
diff --git a/RhSolutions.AddIn/Tools/OcrTool.cs b/RhSolutions.AddIn/Tools/OcrTool.cs
index 96ec4ca..ae460ca 100644
--- a/RhSolutions.AddIn/Tools/OcrTool.cs
+++ b/RhSolutions.AddIn/Tools/OcrTool.cs
@@ -55,10 +55,18 @@ internal class OcrTool : ITool
{
Range excelCell = app.ActiveSheet.Cells(currentCell.Row + row,
currentCell.Column + column);
- excelCell.Value2 = table[row,column];
- excelCell.EntireColumn.AutoFit();
- excelCell.EntireRow.AutoFit();
+ excelCell.Value2 = table[row, column];
}
+
+ 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();
}
}