PDA

View Full Version : Embedded excel object .TickLabelSpacing edit



mooseman
02-29-2012, 01:45 PM
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?
Any help would be great.
Thanks ahead of time



If oSh.Type = msoEmbeddedOLEObject Then
oSh.OLEFormat.Activate
With oSh.OLEFormat.Object
.ActiveChart.Axes(xlCategory).Select
.ActiveChart.Axes(xlCategory).TickMarkSpacing = 316
.ActiveChart.Axes(xlCategory).TickLabelSpacing = 316
End With
End If

mooseman
03-01-2012, 07:55 AM
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 thoughts?
Thanks in advance

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

mooseman
03-20-2012, 08:24 AM
Nothing? Does anyone even lurk on this board?

Does anyone know of a well trafficked PowerPoint forum?