PC Review


Reply
Thread Tools Rate Thread

Copy charts to powerpoint

 
 
Graham Whitehead
Guest
Posts: n/a
 
      3rd Jul 2008
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


 
Reply With Quote
 
 
 
 
John Bundy
Guest
Posts: n/a
 
      3rd Jul 2008
Can you show a little more code, need to see the loop logic.
--
-John
Please rate when your question is answered to help us and others know what
is helpful.


"Graham Whitehead" wrote:

> 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
>
>
>

 
Reply With Quote
 
Graham Whitehead
Guest
Posts: n/a
 
      4th Jul 2008
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

"John Bundy" <(E-Mail Removed)(remove)> wrote in message
news:A1A06E00-35F4-43DC-9DB7-(E-Mail Removed)...
> Can you show a little more code, need to see the loop logic.
> --
> -John
> Please rate when your question is answered to help us and others know what
> is helpful.
>
>
> "Graham Whitehead" wrote:
>
> > 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
> >
> >
> >



 
Reply With Quote
 
ryguy7272
Guest
Posts: n/a
 
      4th Jul 2008
Take a look at this:
http://www.ozgrid.com/forum/showthread.php?t=34916

Regards,
Ryan---


--
RyGuy


"Graham Whitehead" wrote:

> 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
>
> "John Bundy" <(E-Mail Removed)(remove)> wrote in message
> news:A1A06E00-35F4-43DC-9DB7-(E-Mail Removed)...
> > Can you show a little more code, need to see the loop logic.
> > --
> > -John
> > Please rate when your question is answered to help us and others know what
> > is helpful.
> >
> >
> > "Graham Whitehead" wrote:
> >
> > > 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
> > >
> > >
> > >

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Access Charts copy to PowerPoint RS Microsoft Access Reports 2 14th May 2009 10:02 PM
Access Charts copy to PowerPoint RS Microsoft Access Reports 0 14th May 2009 05:56 AM
Copy/Paste Charts; Define Destination of Charts in PowerPoint ryguy7272 Microsoft Excel Programming 2 24th Jan 2008 08:04 PM
copy Excel charts to PowerPoint and Word =?Utf-8?B?Q2VzYXIgQ2FtYXJnb3M=?= Microsoft Excel Programming 3 17th Feb 2007 03:12 PM
Copy format between charts in PowerPoint Mr. Smith Microsoft Powerpoint 4 3rd Mar 2006 08:50 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:20 AM.