Copy charts to powerpoint

  • Thread starter Graham Whitehead
  • Start date
G

Graham Whitehead

Hi,

I have a number of charts that are control from a main data range in excel.
I have some code to write these to a number of power point slide. However,
occasionally I am getting the message:

shape (unknown member): invalid request. to select a shapem its view must
be active

My code sets the charts in a loop and then calls the same module to control
the copying - which is

'Find the open powerpoint template and make it visible
Set ppApp = GetObject(, "PowerPoint.Application")
ppApp.Visible = True
'goto the relevant slide in the presentation
Set ppSlide = ppApp.ActivePresentation.Slides(intSlideCount)
ppApp.ActivePresentation.Slides(intSlideCount).Select
ppSlide.Select
'paste the chart
ppSlide.Shapes.Paste.Select
intSlideCount = intSlideCount + 1 'increase the slide count variable

It is the line ppSlide.Shapes.Paste.Select that is highlighed when debug is
selected. I cant understand this because it falls over on different slides.

Any help anyone could offer me would be gratefully received.

Many thank
 
G

Graham Whitehead

There really isnt much to the loop just setting headings to display the
appropraite information to populate the charts - and the copy and paste
module is called

For x = 1 To 7
Windows(wbSourceWB).Activate
Sheets("Data Comparison").Select
Range("D2").Value = arrGlobalChannel(2)
Range("D3").Value = arrMidChannel(1)
Range("D5").Value = arrTopEvType(6)
Range("D6").Value = arrBottomEvType(x)
Call Copy_Charts(This_Sheet, intSlideCount, ppApp, ppSlide,
wbSourceWB)
Next x
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top