2003图表中的数据工作表是什么对象
要求:用vba修改工作表里的数值,比如改成1,2,3,4,5,6在2010版里可以用shape--chart--chartdata--worksheetl来修改工作表里的值但用2003版做的图表不行,判定是Shapes(1).Type = msoEmbeddedOLEObject,不是图表对象,而是OLE对象了,求教该用哪个对象属性? Sub test()
Dim objShapes As Object
Dim slidecount As Byte, shapecount As Byte
slidecount = ActivePresentation.Slides.Count
For j = 1 To slidecount
With ActivePresentation.Slides(j)
shapecount = ActivePresentation.Slides(j).Shapes.Count
For i = 1 To shapecount
If .Shapes(i).Type = msoEmbeddedOLEObject Then
If .Shapes(i).OLEFormat.ProgID = "MSGraph.Chart.8" Then
Set objShapes = .Shapes(i).OLEFormat.Object
With objShapes.Application.DataSheet
For p = 2 To 7
.Cells(2, p).Value = p - 1
Next
End With
End If
End If
Next
End With
Next
End Sub
页:
[1]