ActiveChart.SeriesCollection(1).Values = arrValue     “ arrValue”是一个单精度single数组,可是每次都出现这个错误,请各位大虾帮帮忙    

解决方案 »

  1.   


    '看一下也许对你有帮助
    '在使用之前先要创建
       Sub Series()
           'Dimension variable x as Integer data type
           Dim x as Integer
           Sheets("Sheet1").Select
           ActiveSheet.ChartObjects(1).Select
           Selection.Chart.SeriesCollection.Add Source:=Range("A1") '先增加一个
           x = Selection.Chart.SeriesCollection.Count    '设置要对最后一个进行处理
           Selection.Chart.SeriesCollection(x).Values = Array(5, 6, 7)   '注意此处进行值,与你的有何不同。
       End Sub
      

  2.   

    可以把数组中的数据合成一个字符串。
    如str="5,6,7,8"
    ActiveChart.SeriesCollection(1).Values = split(str,",")