private void Initialize(XLCell cell) { Author = cell.Worksheet.Author; Container = this; Anchor = XLDrawingAnchor.MoveAndSizeWithCells; Style = new XLDrawingStyle(); Int32 pRow = cell.Address.RowNumber; Double pRowOffset = 0; if (pRow > 1) { pRow--; double prevHeight = cell.CellAbove().WorksheetRow().Height; if (prevHeight > 7) { pRowOffset = prevHeight - 7; } } Position = new XLDrawingPosition { Column = cell.Address.ColumnNumber + 1, ColumnOffset = 2, Row = pRow, RowOffset = pRowOffset }; ZOrder = cell.Worksheet.ZOrder++; Style .Margins.SetLeft(0.1) .Margins.SetRight(0.1) .Margins.SetTop(0.05) .Margins.SetBottom(0.05) .Margins.SetAutomatic() .Size.SetHeight(59.25) .Size.SetWidth(19.2) .ColorsAndLines.SetLineColor(XLColor.Black) .ColorsAndLines.SetFillColor(XLColor.FromArgb(255, 255, 225)) .ColorsAndLines.SetLineDash(XLDashStyle.Solid) .ColorsAndLines.SetLineStyle(XLLineStyle.Single) .ColorsAndLines.SetLineWeight(0.75) .ColorsAndLines.SetFillTransparency(1) .ColorsAndLines.SetLineTransparency(1) .Alignment.SetHorizontal(XLDrawingHorizontalAlignment.Left) .Alignment.SetVertical(XLDrawingVerticalAlignment.Top) .Alignment.SetDirection(XLDrawingTextDirection.Context) .Alignment.SetOrientation(XLDrawingTextOrientation.LeftToRight) .Properties.SetPositioning(XLDrawingAnchor.Absolute) .Protection.SetLocked() .Protection.SetLockText(); _cell = cell; ShapeId = cell.Worksheet.Workbook.ShapeIdManager.GetNext(); }