无法访问 vb.net 中(epplus 的)Excel 绘图的某些属性 class

Can't have access to some propertys of the ExcelDrawing (of epplus) class in vb.net

我正在做 vb.net 申请。当我使用 ExcelDrawing class 的对象时,我无法访问此 class 具有的所有属性。

在我的 ExcelDrawing class 我有这个属性:

Namespace OfficeOpenXml.Drawing
Public Class ExcelDrawing
Inherits XmlHelper
Implements IDisposable

Public Const EMU_PER_PIXEL As Integer = 9525
Protected _drawings As ExcelDrawings
Protected _topNode As XmlNode
Protected Friend _id As Integer
Protected Friend _width As Integer
Protected Friend _height As Integer
Protected Friend _top As Integer
Protected Friend _left As Integer

Public ReadOnly Property From As ExcelPosition
'     Print drawing with sheet
Public Property Print As Boolean
Public ReadOnly Property [To] As ExcelPosition
Public Property Locked As Boolean
Public Property EditAs As eEditAs
Public Property Name As String

Public Overridable Sub SetSize(Percent As Integer)
Public Overridable Sub Dispose()
Public Sub SetSize(PixelWidth As Integer, PixelHeight As Integer)
Public Sub SetPosition(Row As Integer, RowOffsetPixels As Integer, Column As Integer, ColumnOffsetPixels As Integer)
Public Sub SetPosition(PixelTop As Integer, PixelLeft As Integer)
Public Sub AdjustPositionAndSize()
Public Class ExcelPosition
    Inherits XmlHelper

    Public Property Column As Integer
    Public Property Row As Integer
    '     Row Offset EMU units 1cm = 1/360000 1US inch = 1/914400 1pixel = 1/9525
    Public Property RowOff As Integer
End Class
End Class
End Namespace

但例如在 Internet 示例中,他们可以访问所有属性(可能是因为他们使用的是 C#?):

   var shape = ws.Drawings.AddShape("txtDesc", eShapeStyle.Rect);
    shape.SetPosition(1, 5, 6, 5);
    shape.SetSize(400, 200);
    shape.Text = "This example"
    shape.Fill.Style = eFillStyle.SolidFill;
    shape.Fill.Color = Color.DarkSlateGray;
    shape.Fill.Transparancy = 20;
    shape.Border.Fill.Style = eFillStyle.SolidFill;
    shape.Border.LineStyle = eLineStyle.LongDash;
    shape.Border.Width = 1;
    shape.Border.Fill.Color = Color.Black;
    shape.Border.LineCap = eLineCap.Round;
    shape.TextAnchoring = eTextAnchoringType.Top;
    shape.TextVertical = eTextVerticalType.Horizontal;
    shape.TextAnchoringControl=false;

Drawings.AddShape returns Drawing.ExcelShape 不是 ExcelDrawing.

是的,就是这样。我在写:

Dim shapeExisting As Drawing.ExcelDrawing = sheet1.Drawings("CabSup")

代替:

Dim shapeExisting As Drawing.ExcelShape = sheet1.Drawings("CabSup")

但现在可以访问 属性,当我尝试修改 Excel 已经存在的形状的颜色时出现此错误:

error190000_01.xmlSe 错误检测 归档 "C:\Users\Federico\Desktop\ITD\Templates\TTD_5Col_2Bob_TD(amb3).xlsx" 登记处 reparados: Dibujo de /xl/drawings/drawing1.xml parte (Forma de dibujo)

谢谢。