I have written a code to copy charts dynamically from an excel workbook to a powerpoint presentation. What i am trying to do now is change the slide titles for each slide dynamically. here is a snippet of the code :
PPApp.ActivePresentation.Slides.Add PPApp.ActivePresentation.Slides.Count + 1, ppLayoutBlank
PPApp.ActiveWindow.View.GotoSlide PPApp.ActivePresentation.Slides.Count
Sheets("sheet1").Range("V1").Value = h
Sheets("sheet1").Range("V11").Value = j
Sheets("sheet1").Range("V22").Value = k
Sheets("sheet1").Select
ActiveSheet.ChartObjects("Chart 5").Activate
ActiveSheet.ChartObjects("Chart 5").CopyPicture
PPApp.ActiveWindow.View.Paste
eachslideheader = Range("v2").Text & "my chart"
PPApp.ActivePresentation.Slides.ppLayoutTitle.Add
PPApp.ActivePresentation.Slides.pplayouTitle.TextFrame.TextRange.Text = eachslideheader
This code gives an error while insert the title i am unable to figure it out.How should i proceed.Please help