EPPlusSoftware / EPPlus

EPPlus-Excel spreadsheets for .NET
https://epplussoftware.com
Other
1.8k stars 274 forks source link

RangeCopyHelper.CopyDrawings() throws "Object reference not set to an instance of an object." #1651

Open CarlVerret opened 4 days ago

CarlVerret commented 4 days ago

EPPlus usage

Noncommercial use

Environment

Windows

Epplus version

since 7.2

Spreadsheet application

No response

Description

Since version 7.2, copying a row as a new rows within a worksheet throws exception, unless we do specify this flag - ExcelRangeCopyOptionFlags.ExcludeDrawings :

// rowNumber + 1 is the destination row (copying a template row as new row in the worksheet) ws.Cells["A8:M8"].Copy(ws.Cells[$"A{rowNumber + 1}:M{rowNumber + 1}"], ExcelRangeCopyOptionFlags.ExcludeDrawings); `
Exception seems to come from RangeCopyHelper.CopyDrawings()

JanKallman commented 4 days ago

This is likely the same as issue #1645. This happens is you have a drawing with One-Cell anchor or Absolut positioning. A fix is on the way.