|
在excel chart,以下代码成立。但在Ppt VBA下,不成立。
.Axes(xlValue, xlSecondary).Select
Selection.TickLabels.Font.Size = 10
- ''
- Sub ll2()
- Dim Pres As Presentation
- Dim Sld As Slide, ShpRng As ShapeRange
- Dim Arr1, Arr2
- Dim xChart As Chart
- Dim Ww As Workbook
- ''
- Dim Sht As Worksheet
- Dim Rng As Range
- Dim ii, jj, Str
- Dim Arr(7)
- Set Pres = Application.ActivePresentation
- Set Sld = Pres.Slides(1)
- Set xChart = Sld.Shapes(4).Chart
-
-
- With xChart
-
- For ii = .SeriesCollection.Count To 1 Step -1
- .SeriesCollection(ii).Delete
- Next ii
- .ChartData.Activate
- 'Stop
- Set Sht = .ChartData.Workbook.Worksheets(1)
- Set Rng = Sht.Range("a1:i5")
- .SetSourceData "=" & Sht.Name & "!" & Rng.Address, xlRows
- .HasDataTable = True
- .HasLegend = False
- .DataTable.Font.Size = 10
- .Axes(xlValue).Select
- 'ActiveWindow.Selection.TextRange.Font.Size = 9
- 'Selection.TickLabels.Font.Size = 10
- '.Axes(xlValue, xlSecondary).Select
- 'Selection.TickLabels.Font.Size = 10
-
- For ii = 1 To 4 'To 1 Step -1
- Select Case ii
- Case 1, 2
- .SeriesCollection(ii).ChartType = xlColumnClustered 'xlColumnStacked
- Case 3, 4
- .SeriesCollection(ii).ChartType = xlLine
- .SeriesCollection(ii).AxisGroup = 2
- End Select
- Next ii
-
- End With
- End Sub
复制代码 |
|