diff options
author | Serghei Cebotari <serghei@cebotari.ru> | 2025-04-28 10:10:00 +0300 |
---|---|---|
committer | Serghei Cebotari <serghei@cebotari.ru> | 2025-04-28 10:10:00 +0300 |
commit | 4902d3361008579949fbc7734b5ed25ed2063691 (patch) | |
tree | 01212f803b99a23e734ffc7cc4e4d2eab2280475 /RhSolutions.SkuParser.Api/Services/CommonExcelParser.cs | |
parent | c5320becab70208cb66527517a4576724355b208 (diff) |
Refactor worksheet selection to prioritize active tab in Excel parsers
Diffstat (limited to 'RhSolutions.SkuParser.Api/Services/CommonExcelParser.cs')
-rw-r--r-- | RhSolutions.SkuParser.Api/Services/CommonExcelParser.cs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/RhSolutions.SkuParser.Api/Services/CommonExcelParser.cs b/RhSolutions.SkuParser.Api/Services/CommonExcelParser.cs index 206200d..eb4e1bb 100644 --- a/RhSolutions.SkuParser.Api/Services/CommonExcelParser.cs +++ b/RhSolutions.SkuParser.Api/Services/CommonExcelParser.cs @@ -9,7 +9,7 @@ public class CommonExcelParser : ISkuParser public Dictionary<Product, double> ParseProducts(IFormFile file)
{
using XLWorkbook workbook = new(file.OpenReadStream());
- IXLWorksheet ws = workbook.Worksheet(1);
+ IXLWorksheet ws = workbook.Worksheets.FirstOrDefault(ws => ws.TabActive) ?? workbook.Worksheet(1);
var leftTop = ws.FirstCellUsed()?.Address;
var rightBottom = ws.LastCellUsed()?.Address;
|