mooseman
Board Regular
- Joined
- Jul 23, 2004
- Messages
- 195
I have many embedded objects in PowerPoint 2007 that contain a chart and a data sheet.
I need to dynamically change the label and tick mark spacing
This will run, but it doesn't change the values to 316 (I'll be using a variable later).
Do I need to activate the axes or the chart itself?
I have gotten this far, but one line seems to run, but not make the actual change to the axes. The line in red will not make any changes.
Any help would be great.
Thanks ahead of time
Dim oSh As Shape
Dim oSl As Slide
Dim oSheet As Object
Dim PPApp As PowerPoint.Application
Dim PPPres As PowerPoint.Presentation
For Each oSl In ActivePresentation.Slides
For Each oSh In oSl.Shapes
ActiveWindow.View.GotoSlide oSl.SlideIndex
If oSh.Type = msoEmbeddedOLEObject Then
If oSh.Name = "TwoLabelAxes" Then
oSh.OLEFormat.Activate
With oSh.OLEFormat.Object
dates = .Application.Workbooks(1).Worksheets(1).Range("D1").Value
.ActiveChart.Axes(xlCategory).TickMarkSpacing = dates
End With
End If
ActiveWindow.Selection.Unselect
ActiveWindow.View.GotoSlide oSl.SlideIndex
End If
Next
Next
I need to dynamically change the label and tick mark spacing
This will run, but it doesn't change the values to 316 (I'll be using a variable later).
Do I need to activate the axes or the chart itself?
I have gotten this far, but one line seems to run, but not make the actual change to the axes. The line in red will not make any changes.
Any help would be great.
Thanks ahead of time
Dim oSh As Shape
Dim oSl As Slide
Dim oSheet As Object
Dim PPApp As PowerPoint.Application
Dim PPPres As PowerPoint.Presentation
For Each oSl In ActivePresentation.Slides
For Each oSh In oSl.Shapes
ActiveWindow.View.GotoSlide oSl.SlideIndex
If oSh.Type = msoEmbeddedOLEObject Then
If oSh.Name = "TwoLabelAxes" Then
oSh.OLEFormat.Activate
With oSh.OLEFormat.Object
dates = .Application.Workbooks(1).Worksheets(1).Range("D1").Value
.ActiveChart.Axes(xlCategory).TickMarkSpacing = dates
End With
End If
ActiveWindow.Selection.Unselect
ActiveWindow.View.GotoSlide oSl.SlideIndex
End If
Next
Next