Code:
Set PPSlide = ActivePresentation.Slides(Application.ActiveWindow.Selection.SlideRange.SlideIndex)
Set MyText = PPSlide.Shapes("TextBox TV")
MyText.TextRange = XLApp.Range("TVAd")
Gives this error code - which I assume is because of the ".TextRange". Whereas this works just fine:-
Code:
Set PPSlide = ActivePresentation.Slides(Application.ActiveWindow.Selection.SlideRange.SlideIndex)
PPSlide.Shapes("TextBox TV").Select
ActiveWindow.Selection.TextRange = XLApp.Range("TVAd")
And so does this (for testing purposes!!):-
Code:
Set PPSlide = ActivePresentation.Slides(Application.ActiveWindow.Selection.SlideRange.SlideIndex)
Set myitem = PPSlide.Shapes("TVAdVisibility Amber")
With myitem
With .Fill
.ForeColor.RGB = RGB(255, 0, 0)
.ForeColor.RGB = RGB(255, 192, 0)
.Visible = msoFalse
.Visible = msoTrue
End With
End With
(I know I'm trying to do this for a TextBox & the other example is a Shape.)
Obviously I'd like to eliminate "Selects" &, perhaps, simplify my code writing by using "MyText" over & over. Perhaps, if I can get it working, I could use an array of names (I'll amend so they're the same in Excel as in PowerPoint) with a loop?
Any ideas?
Many thanks,
D€$