运行以下代码以使用Vb.net执行AverageIfs时出现错误“WorksheetFunction类的AverageIfs方法失败”
APPR = New Excel.Application
Reportworkbook = APPR.Workbooks.Open(fd_file.FileName)
Reportworkbook.CheckCompatibility = False
APPR.DisplayAlerts = False
APPR.Visible = True
Dataworksheet = Reportworkbook.Worksheets("Data") ' the sheet name is Data
Dim col As Excel.Range = Dataworksheet.Columns(6)
Dim cellname As Excel.Range = Dataworksheet.Columns(4)
Dim ss As String
ss = APPR.WorksheetFunction.AverageIfs(col, cellname, Dataworksheet.Cells(18, 4))