int startRow = targetRow + 1;
int endRow = sheet.LastDataRow;
使用spire.xls for net 时候,当获取文本最后一行没问题,当文本下面还有图片的时候,获取的时候将无法获取到图片的最后一行,
是否有问题解决呢
Workbook wb = new Workbook();
wb.LoadFromFile(@"test.xlsx");
Worksheet sheet = wb.Worksheets[0];
PicturesCollection pc = sheet.Pictures;
for (int i = 0; i < pc.Count; i++)
{
ExcelPicture picture = pc[i];
var rowtop = picture.TopRow;
// 單位轉換
var cellHeightPoints = sheet.GetRowHeight(rowtop);
var cellhight=cellHeightPoints * 96.0 / 72.0;
int picHeight= picture.Height;
int index = (int)(picHeight / cellhight);
int rowbuttom = rowtop + (int)(picHeight / cellhight);
Console.WriteLine(rowbuttom);
}