Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.charting
mustang25
 
Posts: n/a
Default Multiple Excel Charts to PowerPoint

OK, I think I have a question that will stump even the best of you! :)

I have several worksheets that contain multiple charts. I want to copy the
charts from Excel to PowerPoint with one chart to a slide. I can do so one
at a time by copying and pasting them. The drawback is that it takes lots of
time to do this because I'm working with 250+ charts. My question is if
there is a way to quickly export the charts to PowerPoint so that each slide
contains a different chart.
  #2   Report Post  
Posted to microsoft.public.excel.charting
Jon Peltier
 
Posts: n/a
Default Multiple Excel Charts to PowerPoint

Partway through this article you'll find programmatic approaches to that
very problem:

http://peltiertech.com/Excel/XL_PPT.html

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______

"mustang25" wrote in message
...
OK, I think I have a question that will stump even the best of you! :)

I have several worksheets that contain multiple charts. I want to copy
the
charts from Excel to PowerPoint with one chart to a slide. I can do so
one
at a time by copying and pasting them. The drawback is that it takes lots
of
time to do this because I'm working with 250+ charts. My question is if
there is a way to quickly export the charts to PowerPoint so that each
slide
contains a different chart.



  #3   Report Post  
Posted to microsoft.public.excel.charting
mustang25
 
Posts: n/a
Default Multiple Excel Charts to PowerPoint

It amazes me to see the amount of knowledge stored on these forums. I'm
seriously impressed that there is an answer to my question. Thank you Jon.

Unfortunately, my VB skills are at about the same level as my 2 year old
son's. In other words, I don't know the first thing about it. I figured out
how to paste the code into the VBE, but when I try to run the macro, I get an
error saying "User Type not Defined." I know this has to be a very basic
issue, but like I said, I don't know the first thing about VB. Am I better
off just copying and pasting my charts one at a time?

"Jon Peltier" wrote:

Partway through this article you'll find programmatic approaches to that
very problem:

http://peltiertech.com/Excel/XL_PPT.html

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______

"mustang25" wrote in message
...
OK, I think I have a question that will stump even the best of you! :)

I have several worksheets that contain multiple charts. I want to copy
the
charts from Excel to PowerPoint with one chart to a slide. I can do so
one
at a time by copying and pasting them. The drawback is that it takes lots
of
time to do this because I'm working with 250+ charts. My question is if
there is a way to quickly export the charts to PowerPoint so that each
slide
contains a different chart.




  #4   Report Post  
Posted to microsoft.public.excel.charting
Jon Peltier
 
Posts: n/a
Default Multiple Excel Charts to PowerPoint

I suspect you didn't set the reference to PowerPoint. It's described higher
on the page than the specific code you must have copied. Just under the big
title "Activating Other Applications with Excel VBA".

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______

"mustang25" wrote in message
...
It amazes me to see the amount of knowledge stored on these forums. I'm
seriously impressed that there is an answer to my question. Thank you
Jon.

Unfortunately, my VB skills are at about the same level as my 2 year old
son's. In other words, I don't know the first thing about it. I figured
out
how to paste the code into the VBE, but when I try to run the macro, I get
an
error saying "User Type not Defined." I know this has to be a very basic
issue, but like I said, I don't know the first thing about VB. Am I
better
off just copying and pasting my charts one at a time?

"Jon Peltier" wrote:

Partway through this article you'll find programmatic approaches to that
very problem:

http://peltiertech.com/Excel/XL_PPT.html

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______

"mustang25" wrote in message
...
OK, I think I have a question that will stump even the best of you! :)

I have several worksheets that contain multiple charts. I want to copy
the
charts from Excel to PowerPoint with one chart to a slide. I can do so
one
at a time by copying and pasting them. The drawback is that it takes
lots
of
time to do this because I'm working with 250+ charts. My question is
if
there is a way to quickly export the charts to PowerPoint so that each
slide
contains a different chart.






  #5   Report Post  
Posted to microsoft.public.excel.charting
mustang25
 
Posts: n/a
Default Multiple Excel Charts to PowerPoint

Wow! You, sir, are my hero! Thank you very much!

"Jon Peltier" wrote:

I suspect you didn't set the reference to PowerPoint. It's described higher
on the page than the specific code you must have copied. Just under the big
title "Activating Other Applications with Excel VBA".

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______

"mustang25" wrote in message
...
It amazes me to see the amount of knowledge stored on these forums. I'm
seriously impressed that there is an answer to my question. Thank you
Jon.

Unfortunately, my VB skills are at about the same level as my 2 year old
son's. In other words, I don't know the first thing about it. I figured
out
how to paste the code into the VBE, but when I try to run the macro, I get
an
error saying "User Type not Defined." I know this has to be a very basic
issue, but like I said, I don't know the first thing about VB. Am I
better
off just copying and pasting my charts one at a time?

"Jon Peltier" wrote:

Partway through this article you'll find programmatic approaches to that
very problem:

http://peltiertech.com/Excel/XL_PPT.html

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______

"mustang25" wrote in message
...
OK, I think I have a question that will stump even the best of you! :)

I have several worksheets that contain multiple charts. I want to copy
the
charts from Excel to PowerPoint with one chart to a slide. I can do so
one
at a time by copying and pasting them. The drawback is that it takes
lots
of
time to do this because I'm working with 250+ charts. My question is
if
there is a way to quickly export the charts to PowerPoint so that each
slide
contains a different chart.








  #6   Report Post  
Posted to microsoft.public.excel.charting
mustang25
 
Posts: n/a
Default Multiple Excel Charts to PowerPoint

Jon,

This is working brilliantly. I'd like to throw one more challenge at you if
you don't mind. It follows below. Here is the code I'm using for the macro
(you'll notice that I removed the line/command that copies the chart as a
picture. This is intentional.):

Sub ChartsToPresentation()
' Set a VBE reference to Microsoft PowerPoint Object Library

Dim PPApp As PowerPoint.Application
Dim PPPres As PowerPoint.Presentation
Dim PPSlide As PowerPoint.Slide
Dim PresentationFileName As Variant
Dim SlideCount As Long
Dim iCht As Integer

' Reference existing instance of PowerPoint
Set PPApp = GetObject(, "Powerpoint.Application")
' Reference active presentation
Set PPPres = PPApp.ActivePresentation
PPApp.ActiveWindow.ViewType = ppViewSlide

For iCht = 1 To ActiveSheet.ChartObjects.Count
' copy chart as a picture
ActiveSheet.ChartObjects(iCht).Copy

' Add a new slide and paste in the chart
SlideCount = PPPres.Slides.Count
Set PPSlide = PPPres.Slides.Add(SlideCount + 1, ppLayoutBlank)
PPApp.ActiveWindow.View.GotoSlide PPSlide.SlideIndex
With PPSlide
' paste and select the chart picture
.Shapes.Paste.Select
' align the chart
PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignCenters, True
PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignMiddles, True
End With

Next

' Clean up
Set PPSlide = Nothing
Set PPPres = Nothing
Set PPApp = Nothing

End Sub

Is there a way to output the charts to PowerPoint with the following
parameters:

Height 5.66 inches
Width 9.66 inches
Horizontal Position 0 inches from top left corner
Vertical Position 1 inch from top left corner

Many thanks in advance!


"Jon Peltier" wrote:

I suspect you didn't set the reference to PowerPoint. It's described higher
on the page than the specific code you must have copied. Just under the big
title "Activating Other Applications with Excel VBA".

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______

"mustang25" wrote in message
...
It amazes me to see the amount of knowledge stored on these forums. I'm
seriously impressed that there is an answer to my question. Thank you
Jon.

Unfortunately, my VB skills are at about the same level as my 2 year old
son's. In other words, I don't know the first thing about it. I figured
out
how to paste the code into the VBE, but when I try to run the macro, I get
an
error saying "User Type not Defined." I know this has to be a very basic
issue, but like I said, I don't know the first thing about VB. Am I
better
off just copying and pasting my charts one at a time?

"Jon Peltier" wrote:

Partway through this article you'll find programmatic approaches to that
very problem:

http://peltiertech.com/Excel/XL_PPT.html

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______

"mustang25" wrote in message
...
OK, I think I have a question that will stump even the best of you! :)

I have several worksheets that contain multiple charts. I want to copy
the
charts from Excel to PowerPoint with one chart to a slide. I can do so
one
at a time by copying and pasting them. The drawback is that it takes
lots
of
time to do this because I'm working with 250+ charts. My question is
if
there is a way to quickly export the charts to PowerPoint so that each
slide
contains a different chart.






  #7   Report Post  
Posted to microsoft.public.excel.charting
Jon Peltier
 
Posts: n/a
Default Multiple Excel Charts to PowerPoint

In a different forum I answered one way, that you should make it in Excel so
that it comes out right in PowerPoint. I stick by that, but I'll answer the
other way as well. You can adjust this part of the code to handle resizing
of the chart.

With PPSlide
' paste and select the chart picture
.Shapes.Paste.Select
' align the chart
PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignCenters, True
PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignMiddles, True
End With

Instead of centering the chart, position and resize it:

With PPSlide
' paste and select the chart picture
.Shapes.Paste.Select
' position the chart
With PPApp.ActiveWindow.Selection.ShapeRange
.Top = 72 ' points
.Left = 0
.Width = 9.66 * 72
.Height = 5.66 * 72
End With
End With

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"mustang25" wrote in message
...
Jon,

This is working brilliantly. I'd like to throw one more challenge at you
if
you don't mind. It follows below. Here is the code I'm using for the
macro
(you'll notice that I removed the line/command that copies the chart as a
picture. This is intentional.):

Sub ChartsToPresentation()
' Set a VBE reference to Microsoft PowerPoint Object Library

Dim PPApp As PowerPoint.Application
Dim PPPres As PowerPoint.Presentation
Dim PPSlide As PowerPoint.Slide
Dim PresentationFileName As Variant
Dim SlideCount As Long
Dim iCht As Integer

' Reference existing instance of PowerPoint
Set PPApp = GetObject(, "Powerpoint.Application")
' Reference active presentation
Set PPPres = PPApp.ActivePresentation
PPApp.ActiveWindow.ViewType = ppViewSlide

For iCht = 1 To ActiveSheet.ChartObjects.Count
' copy chart as a picture
ActiveSheet.ChartObjects(iCht).Copy

' Add a new slide and paste in the chart
SlideCount = PPPres.Slides.Count
Set PPSlide = PPPres.Slides.Add(SlideCount + 1, ppLayoutBlank)
PPApp.ActiveWindow.View.GotoSlide PPSlide.SlideIndex
With PPSlide
' paste and select the chart picture
.Shapes.Paste.Select
' align the chart
PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignCenters, True
PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignMiddles, True
End With

Next

' Clean up
Set PPSlide = Nothing
Set PPPres = Nothing
Set PPApp = Nothing

End Sub

Is there a way to output the charts to PowerPoint with the following
parameters:

Height 5.66 inches
Width 9.66 inches
Horizontal Position 0 inches from top left corner
Vertical Position 1 inch from top left corner

Many thanks in advance!


"Jon Peltier" wrote:

I suspect you didn't set the reference to PowerPoint. It's described
higher
on the page than the specific code you must have copied. Just under the
big
title "Activating Other Applications with Excel VBA".

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______

"mustang25" wrote in message
...
It amazes me to see the amount of knowledge stored on these forums.
I'm
seriously impressed that there is an answer to my question. Thank you
Jon.

Unfortunately, my VB skills are at about the same level as my 2 year
old
son's. In other words, I don't know the first thing about it. I
figured
out
how to paste the code into the VBE, but when I try to run the macro, I
get
an
error saying "User Type not Defined." I know this has to be a very
basic
issue, but like I said, I don't know the first thing about VB. Am I
better
off just copying and pasting my charts one at a time?

"Jon Peltier" wrote:

Partway through this article you'll find programmatic approaches to
that
very problem:

http://peltiertech.com/Excel/XL_PPT.html

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______

"mustang25" wrote in message
...
OK, I think I have a question that will stump even the best of you!
:)

I have several worksheets that contain multiple charts. I want to
copy
the
charts from Excel to PowerPoint with one chart to a slide. I can do
so
one
at a time by copying and pasting them. The drawback is that it
takes
lots
of
time to do this because I'm working with 250+ charts. My question
is
if
there is a way to quickly export the charts to PowerPoint so that
each
slide
contains a different chart.








  #8   Report Post  
Posted to microsoft.public.excel.charting
mustang25
 
Posts: n/a
Default Multiple Excel Charts to PowerPoint

Jon,

I see what you meant in the other forum. You are right, the best way to
approach this would be to have the charts sized properly in Excel to begin
with. Be that as it may, your macro has already saved me HOURS of work in
copying each chart to its own slide. I can deal with resizing them manually
for now and will remember to size them properly in Excel the next time I do a
project like this.

Once again, many humble thanks.

"Jon Peltier" wrote:

In a different forum I answered one way, that you should make it in Excel so
that it comes out right in PowerPoint. I stick by that, but I'll answer the
other way as well. You can adjust this part of the code to handle resizing
of the chart.

With PPSlide
' paste and select the chart picture
.Shapes.Paste.Select
' align the chart
PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignCenters, True
PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignMiddles, True
End With

Instead of centering the chart, position and resize it:

With PPSlide
' paste and select the chart picture
.Shapes.Paste.Select
' position the chart
With PPApp.ActiveWindow.Selection.ShapeRange
.Top = 72 ' points
.Left = 0
.Width = 9.66 * 72
.Height = 5.66 * 72
End With
End With

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"mustang25" wrote in message
...
Jon,

This is working brilliantly. I'd like to throw one more challenge at you
if
you don't mind. It follows below. Here is the code I'm using for the
macro
(you'll notice that I removed the line/command that copies the chart as a
picture. This is intentional.):

Sub ChartsToPresentation()
' Set a VBE reference to Microsoft PowerPoint Object Library

Dim PPApp As PowerPoint.Application
Dim PPPres As PowerPoint.Presentation
Dim PPSlide As PowerPoint.Slide
Dim PresentationFileName As Variant
Dim SlideCount As Long
Dim iCht As Integer

' Reference existing instance of PowerPoint
Set PPApp = GetObject(, "Powerpoint.Application")
' Reference active presentation
Set PPPres = PPApp.ActivePresentation
PPApp.ActiveWindow.ViewType = ppViewSlide

For iCht = 1 To ActiveSheet.ChartObjects.Count
' copy chart as a picture
ActiveSheet.ChartObjects(iCht).Copy

' Add a new slide and paste in the chart
SlideCount = PPPres.Slides.Count
Set PPSlide = PPPres.Slides.Add(SlideCount + 1, ppLayoutBlank)
PPApp.ActiveWindow.View.GotoSlide PPSlide.SlideIndex
With PPSlide
' paste and select the chart picture
.Shapes.Paste.Select
' align the chart
PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignCenters, True
PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignMiddles, True
End With

Next

' Clean up
Set PPSlide = Nothing
Set PPPres = Nothing
Set PPApp = Nothing

End Sub

Is there a way to output the charts to PowerPoint with the following
parameters:

Height 5.66 inches
Width 9.66 inches
Horizontal Position 0 inches from top left corner
Vertical Position 1 inch from top left corner

Many thanks in advance!


"Jon Peltier" wrote:

I suspect you didn't set the reference to PowerPoint. It's described
higher
on the page than the specific code you must have copied. Just under the
big
title "Activating Other Applications with Excel VBA".

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______

"mustang25" wrote in message
...
It amazes me to see the amount of knowledge stored on these forums.
I'm
seriously impressed that there is an answer to my question. Thank you
Jon.

Unfortunately, my VB skills are at about the same level as my 2 year
old
son's. In other words, I don't know the first thing about it. I
figured
out
how to paste the code into the VBE, but when I try to run the macro, I
get
an
error saying "User Type not Defined." I know this has to be a very
basic
issue, but like I said, I don't know the first thing about VB. Am I
better
off just copying and pasting my charts one at a time?

"Jon Peltier" wrote:

Partway through this article you'll find programmatic approaches to
that
very problem:

http://peltiertech.com/Excel/XL_PPT.html

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______

"mustang25" wrote in message
...
OK, I think I have a question that will stump even the best of you!
:)

I have several worksheets that contain multiple charts. I want to
copy
the
charts from Excel to PowerPoint with one chart to a slide. I can do
so
one
at a time by copying and pasting them. The drawback is that it
takes
lots
of
time to do this because I'm working with 250+ charts. My question
is
if
there is a way to quickly export the charts to PowerPoint so that
each
slide
contains a different chart.









  #9   Report Post  
Posted to microsoft.public.excel.charting
Jon Peltier
 
Posts: n/a
Default Multiple Excel Charts to PowerPoint

I first got into programming in order to save myself those hours of work.
Tedious redundant work. Laziness is the other of innovation.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"mustang25" wrote in message
...
Jon,

I see what you meant in the other forum. You are right, the best way to
approach this would be to have the charts sized properly in Excel to begin
with. Be that as it may, your macro has already saved me HOURS of work in
copying each chart to its own slide. I can deal with resizing them
manually
for now and will remember to size them properly in Excel the next time I
do a
project like this.

Once again, many humble thanks.

"Jon Peltier" wrote:

In a different forum I answered one way, that you should make it in Excel
so
that it comes out right in PowerPoint. I stick by that, but I'll answer
the
other way as well. You can adjust this part of the code to handle
resizing
of the chart.

With PPSlide
' paste and select the chart picture
.Shapes.Paste.Select
' align the chart
PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignCenters,
True
PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignMiddles,
True
End With

Instead of centering the chart, position and resize it:

With PPSlide
' paste and select the chart picture
.Shapes.Paste.Select
' position the chart
With PPApp.ActiveWindow.Selection.ShapeRange
.Top = 72 ' points
.Left = 0
.Width = 9.66 * 72
.Height = 5.66 * 72
End With
End With

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"mustang25" wrote in message
...
Jon,

This is working brilliantly. I'd like to throw one more challenge at
you
if
you don't mind. It follows below. Here is the code I'm using for the
macro
(you'll notice that I removed the line/command that copies the chart as
a
picture. This is intentional.):

Sub ChartsToPresentation()
' Set a VBE reference to Microsoft PowerPoint Object Library

Dim PPApp As PowerPoint.Application
Dim PPPres As PowerPoint.Presentation
Dim PPSlide As PowerPoint.Slide
Dim PresentationFileName As Variant
Dim SlideCount As Long
Dim iCht As Integer

' Reference existing instance of PowerPoint
Set PPApp = GetObject(, "Powerpoint.Application")
' Reference active presentation
Set PPPres = PPApp.ActivePresentation
PPApp.ActiveWindow.ViewType = ppViewSlide

For iCht = 1 To ActiveSheet.ChartObjects.Count
' copy chart as a picture
ActiveSheet.ChartObjects(iCht).Copy

' Add a new slide and paste in the chart
SlideCount = PPPres.Slides.Count
Set PPSlide = PPPres.Slides.Add(SlideCount + 1, ppLayoutBlank)
PPApp.ActiveWindow.View.GotoSlide PPSlide.SlideIndex
With PPSlide
' paste and select the chart picture
.Shapes.Paste.Select
' align the chart
PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignCenters,
True
PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignMiddles,
True
End With

Next

' Clean up
Set PPSlide = Nothing
Set PPPres = Nothing
Set PPApp = Nothing

End Sub

Is there a way to output the charts to PowerPoint with the following
parameters:

Height 5.66 inches
Width 9.66 inches
Horizontal Position 0 inches from top left corner
Vertical Position 1 inch from top left corner

Many thanks in advance!


"Jon Peltier" wrote:

I suspect you didn't set the reference to PowerPoint. It's described
higher
on the page than the specific code you must have copied. Just under
the
big
title "Activating Other Applications with Excel VBA".

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______

"mustang25" wrote in message
...
It amazes me to see the amount of knowledge stored on these forums.
I'm
seriously impressed that there is an answer to my question. Thank
you
Jon.

Unfortunately, my VB skills are at about the same level as my 2 year
old
son's. In other words, I don't know the first thing about it. I
figured
out
how to paste the code into the VBE, but when I try to run the macro,
I
get
an
error saying "User Type not Defined." I know this has to be a very
basic
issue, but like I said, I don't know the first thing about VB. Am I
better
off just copying and pasting my charts one at a time?

"Jon Peltier" wrote:

Partway through this article you'll find programmatic approaches to
that
very problem:

http://peltiertech.com/Excel/XL_PPT.html

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______

"mustang25" wrote in message
...
OK, I think I have a question that will stump even the best of
you!
:)

I have several worksheets that contain multiple charts. I want
to
copy
the
charts from Excel to PowerPoint with one chart to a slide. I can
do
so
one
at a time by copying and pasting them. The drawback is that it
takes
lots
of
time to do this because I'm working with 250+ charts. My
question
is
if
there is a way to quickly export the charts to PowerPoint so that
each
slide
contains a different chart.











  #10   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 148
Default Multiple Excel Charts to PowerPoint

Jon,
Is there a way to bring the chart in as a picture (enhanced metafile)? In
my case, bringing the chart in as a picitre also brings in the excel grid
lines. Guess I could turn off the gridlines, but I really need them as the
spreadsheet is a template for others and I wwant to be able to have everyone
bring in the chart to pp in the same size, location, etc, but with their data.

Thanks,

Danny

"Jon Peltier" wrote:

In a different forum I answered one way, that you should make it in Excel so
that it comes out right in PowerPoint. I stick by that, but I'll answer the
other way as well. You can adjust this part of the code to handle resizing
of the chart.

With PPSlide
' paste and select the chart picture
.Shapes.Paste.Select
' align the chart
PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignCenters, True
PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignMiddles, True
End With

Instead of centering the chart, position and resize it:

With PPSlide
' paste and select the chart picture
.Shapes.Paste.Select
' position the chart
With PPApp.ActiveWindow.Selection.ShapeRange
.Top = 72 ' points
.Left = 0
.Width = 9.66 * 72
.Height = 5.66 * 72
End With
End With

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"mustang25" wrote in message
...
Jon,

This is working brilliantly. I'd like to throw one more challenge at you
if
you don't mind. It follows below. Here is the code I'm using for the
macro
(you'll notice that I removed the line/command that copies the chart as a
picture. This is intentional.):

Sub ChartsToPresentation()
' Set a VBE reference to Microsoft PowerPoint Object Library

Dim PPApp As PowerPoint.Application
Dim PPPres As PowerPoint.Presentation
Dim PPSlide As PowerPoint.Slide
Dim PresentationFileName As Variant
Dim SlideCount As Long
Dim iCht As Integer

' Reference existing instance of PowerPoint
Set PPApp = GetObject(, "Powerpoint.Application")
' Reference active presentation
Set PPPres = PPApp.ActivePresentation
PPApp.ActiveWindow.ViewType = ppViewSlide

For iCht = 1 To ActiveSheet.ChartObjects.Count
' copy chart as a picture
ActiveSheet.ChartObjects(iCht).Copy

' Add a new slide and paste in the chart
SlideCount = PPPres.Slides.Count
Set PPSlide = PPPres.Slides.Add(SlideCount + 1, ppLayoutBlank)
PPApp.ActiveWindow.View.GotoSlide PPSlide.SlideIndex
With PPSlide
' paste and select the chart picture
.Shapes.Paste.Select
' align the chart
PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignCenters, True
PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignMiddles, True
End With

Next

' Clean up
Set PPSlide = Nothing
Set PPPres = Nothing
Set PPApp = Nothing

End Sub

Is there a way to output the charts to PowerPoint with the following
parameters:

Height 5.66 inches
Width 9.66 inches
Horizontal Position 0 inches from top left corner
Vertical Position 1 inch from top left corner

Many thanks in advance!


"Jon Peltier" wrote:

I suspect you didn't set the reference to PowerPoint. It's described
higher
on the page than the specific code you must have copied. Just under the
big
title "Activating Other Applications with Excel VBA".

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______

"mustang25" wrote in message
...
It amazes me to see the amount of knowledge stored on these forums.
I'm
seriously impressed that there is an answer to my question. Thank you
Jon.

Unfortunately, my VB skills are at about the same level as my 2 year
old
son's. In other words, I don't know the first thing about it. I
figured
out
how to paste the code into the VBE, but when I try to run the macro, I
get
an
error saying "User Type not Defined." I know this has to be a very
basic
issue, but like I said, I don't know the first thing about VB. Am I
better
off just copying and pasting my charts one at a time?

"Jon Peltier" wrote:

Partway through this article you'll find programmatic approaches to
that
very problem:

http://peltiertech.com/Excel/XL_PPT.html

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______

"mustang25" wrote in message
...
OK, I think I have a question that will stump even the best of you!
:)

I have several worksheets that contain multiple charts. I want to
copy
the
charts from Excel to PowerPoint with one chart to a slide. I can do
so
one
at a time by copying and pasting them. The drawback is that it
takes
lots
of
time to do this because I'm working with 250+ charts. My question
is
if
there is a way to quickly export the charts to PowerPoint so that
each
slide
contains a different chart.











  #11   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 2,489
Default Multiple Excel Charts to PowerPoint

Hi Danny,

Any reason why you can not turn the gridlines off and back on when your
macro is run?

Cheers
Andy

Danny wrote:
Jon,
Is there a way to bring the chart in as a picture (enhanced metafile)? In
my case, bringing the chart in as a picitre also brings in the excel grid
lines. Guess I could turn off the gridlines, but I really need them as the
spreadsheet is a template for others and I wwant to be able to have everyone
bring in the chart to pp in the same size, location, etc, but with their data.

Thanks,

Danny

"Jon Peltier" wrote:


In a different forum I answered one way, that you should make it in Excel so
that it comes out right in PowerPoint. I stick by that, but I'll answer the
other way as well. You can adjust this part of the code to handle resizing
of the chart.

With PPSlide
' paste and select the chart picture
.Shapes.Paste.Select
' align the chart
PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignCenters, True
PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignMiddles, True
End With

Instead of centering the chart, position and resize it:

With PPSlide
' paste and select the chart picture
.Shapes.Paste.Select
' position the chart
With PPApp.ActiveWindow.Selection.ShapeRange
.Top = 72 ' points
.Left = 0
.Width = 9.66 * 72
.Height = 5.66 * 72
End With
End With

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"mustang25" wrote in message
...

Jon,

This is working brilliantly. I'd like to throw one more challenge at you
if
you don't mind. It follows below. Here is the code I'm using for the
macro
(you'll notice that I removed the line/command that copies the chart as a
picture. This is intentional.):

Sub ChartsToPresentation()
' Set a VBE reference to Microsoft PowerPoint Object Library

Dim PPApp As PowerPoint.Application
Dim PPPres As PowerPoint.Presentation
Dim PPSlide As PowerPoint.Slide
Dim PresentationFileName As Variant
Dim SlideCount As Long
Dim iCht As Integer

' Reference existing instance of PowerPoint
Set PPApp = GetObject(, "Powerpoint.Application")
' Reference active presentation
Set PPPres = PPApp.ActivePresentation
PPApp.ActiveWindow.ViewType = ppViewSlide

For iCht = 1 To ActiveSheet.ChartObjects.Count
' copy chart as a picture
ActiveSheet.ChartObjects(iCht).Copy

' Add a new slide and paste in the chart
SlideCount = PPPres.Slides.Count
Set PPSlide = PPPres.Slides.Add(SlideCount + 1, ppLayoutBlank)
PPApp.ActiveWindow.View.GotoSlide PPSlide.SlideIndex
With PPSlide
' paste and select the chart picture
.Shapes.Paste.Select
' align the chart
PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignCenters, True
PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignMiddles, True
End With

Next

' Clean up
Set PPSlide = Nothing
Set PPPres = Nothing
Set PPApp = Nothing

End Sub

Is there a way to output the charts to PowerPoint with the following
parameters:

Height 5.66 inches
Width 9.66 inches
Horizontal Position 0 inches from top left corner
Vertical Position 1 inch from top left corner

Many thanks in advance!


"Jon Peltier" wrote:


I suspect you didn't set the reference to PowerPoint. It's described
higher
on the page than the specific code you must have copied. Just under the
big
title "Activating Other Applications with Excel VBA".

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______

"mustang25" wrote in message
...

It amazes me to see the amount of knowledge stored on these forums.
I'm
seriously impressed that there is an answer to my question. Thank you
Jon.

Unfortunately, my VB skills are at about the same level as my 2 year
old
son's. In other words, I don't know the first thing about it. I
figured
out
how to paste the code into the VBE, but when I try to run the macro, I
get
an
error saying "User Type not Defined." I know this has to be a very
basic
issue, but like I said, I don't know the first thing about VB. Am I
better
off just copying and pasting my charts one at a time?

"Jon Peltier" wrote:


Partway through this article you'll find programmatic approaches to
that
very problem:

http://peltiertech.com/Excel/XL_PPT.html

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______

"mustang25" wrote in message
...

OK, I think I have a question that will stump even the best of you!
:)

I have several worksheets that contain multiple charts. I want to
copy
the
charts from Excel to PowerPoint with one chart to a slide. I can do
so
one
at a time by copying and pasting them. The drawback is that it
takes
lots
of
time to do this because I'm working with 250+ charts. My question
is
if
there is a way to quickly export the charts to PowerPoint so that
each
slide
contains a different chart.








--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
  #12   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 148
Default Multiple Excel Charts to PowerPoint

Andy,

Thanks. Turning the grid lines off\on via a macro is whjat I ended up
doing. I was just trying to find a more efficient way within the original
macro.

Project is done, but still thinking about the "better mouse trap"!

Danny

"Andy Pope" wrote:

Hi Danny,

Any reason why you can not turn the gridlines off and back on when your
macro is run?

Cheers
Andy

Danny wrote:
Jon,
Is there a way to bring the chart in as a picture (enhanced metafile)? In
my case, bringing the chart in as a picitre also brings in the excel grid
lines. Guess I could turn off the gridlines, but I really need them as the
spreadsheet is a template for others and I wwant to be able to have everyone
bring in the chart to pp in the same size, location, etc, but with their data.

Thanks,

Danny

"Jon Peltier" wrote:


In a different forum I answered one way, that you should make it in Excel so
that it comes out right in PowerPoint. I stick by that, but I'll answer the
other way as well. You can adjust this part of the code to handle resizing
of the chart.

With PPSlide
' paste and select the chart picture
.Shapes.Paste.Select
' align the chart
PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignCenters, True
PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignMiddles, True
End With

Instead of centering the chart, position and resize it:

With PPSlide
' paste and select the chart picture
.Shapes.Paste.Select
' position the chart
With PPApp.ActiveWindow.Selection.ShapeRange
.Top = 72 ' points
.Left = 0
.Width = 9.66 * 72
.Height = 5.66 * 72
End With
End With

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"mustang25" wrote in message
...

Jon,

This is working brilliantly. I'd like to throw one more challenge at you
if
you don't mind. It follows below. Here is the code I'm using for the
macro
(you'll notice that I removed the line/command that copies the chart as a
picture. This is intentional.):

Sub ChartsToPresentation()
' Set a VBE reference to Microsoft PowerPoint Object Library

Dim PPApp As PowerPoint.Application
Dim PPPres As PowerPoint.Presentation
Dim PPSlide As PowerPoint.Slide
Dim PresentationFileName As Variant
Dim SlideCount As Long
Dim iCht As Integer

' Reference existing instance of PowerPoint
Set PPApp = GetObject(, "Powerpoint.Application")
' Reference active presentation
Set PPPres = PPApp.ActivePresentation
PPApp.ActiveWindow.ViewType = ppViewSlide

For iCht = 1 To ActiveSheet.ChartObjects.Count
' copy chart as a picture
ActiveSheet.ChartObjects(iCht).Copy

' Add a new slide and paste in the chart
SlideCount = PPPres.Slides.Count
Set PPSlide = PPPres.Slides.Add(SlideCount + 1, ppLayoutBlank)
PPApp.ActiveWindow.View.GotoSlide PPSlide.SlideIndex
With PPSlide
' paste and select the chart picture
.Shapes.Paste.Select
' align the chart
PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignCenters, True
PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignMiddles, True
End With

Next

' Clean up
Set PPSlide = Nothing
Set PPPres = Nothing
Set PPApp = Nothing

End Sub

Is there a way to output the charts to PowerPoint with the following
parameters:

Height 5.66 inches
Width 9.66 inches
Horizontal Position 0 inches from top left corner
Vertical Position 1 inch from top left corner

Many thanks in advance!


"Jon Peltier" wrote:


I suspect you didn't set the reference to PowerPoint. It's described
higher
on the page than the specific code you must have copied. Just under the
big
title "Activating Other Applications with Excel VBA".

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______

"mustang25" wrote in message
...

It amazes me to see the amount of knowledge stored on these forums.
I'm
seriously impressed that there is an answer to my question. Thank you
Jon.

Unfortunately, my VB skills are at about the same level as my 2 year
old
son's. In other words, I don't know the first thing about it. I
figured
out
how to paste the code into the VBE, but when I try to run the macro, I
get
an
error saying "User Type not Defined." I know this has to be a very
basic
issue, but like I said, I don't know the first thing about VB. Am I
better
off just copying and pasting my charts one at a time?

"Jon Peltier" wrote:


Partway through this article you'll find programmatic approaches to
that
very problem:

http://peltiertech.com/Excel/XL_PPT.html

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______

"mustang25" wrote in message
...

OK, I think I have a question that will stump even the best of you!
:)

I have several worksheets that contain multiple charts. I want to
copy
the
charts from Excel to PowerPoint with one chart to a slide. I can do
so
one
at a time by copying and pasting them. The drawback is that it
takes
lots
of
time to do this because I'm working with 250+ charts. My question
is
if
there is a way to quickly export the charts to PowerPoint so that
each
slide
contains a different chart.








--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info

  #13   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 2,489
Default Multiple Excel Charts to PowerPoint

What if you use .CopyPicture instead

ActiveSheet.ChartObjects(iCht).CopyPicture


Danny wrote:
Andy,

Thanks. Turning the grid lines off\on via a macro is whjat I ended up
doing. I was just trying to find a more efficient way within the original
macro.

Project is done, but still thinking about the "better mouse trap"!

Danny

"Andy Pope" wrote:


Hi Danny,

Any reason why you can not turn the gridlines off and back on when your
macro is run?

Cheers
Andy

Danny wrote:

Jon,
Is there a way to bring the chart in as a picture (enhanced metafile)? In
my case, bringing the chart in as a picitre also brings in the excel grid
lines. Guess I could turn off the gridlines, but I really need them as the
spreadsheet is a template for others and I wwant to be able to have everyone
bring in the chart to pp in the same size, location, etc, but with their data.

Thanks,

Danny

"Jon Peltier" wrote:



In a different forum I answered one way, that you should make it in Excel so
that it comes out right in PowerPoint. I stick by that, but I'll answer the
other way as well. You can adjust this part of the code to handle resizing
of the chart.

With PPSlide
' paste and select the chart picture
.Shapes.Paste.Select
' align the chart
PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignCenters, True
PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignMiddles, True
End With

Instead of centering the chart, position and resize it:

With PPSlide
' paste and select the chart picture
.Shapes.Paste.Select
' position the chart
With PPApp.ActiveWindow.Selection.ShapeRange
.Top = 72 ' points
.Left = 0
.Width = 9.66 * 72
.Height = 5.66 * 72
End With
End With

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"mustang25" wrote in message
...


Jon,

This is working brilliantly. I'd like to throw one more challenge at you
if
you don't mind. It follows below. Here is the code I'm using for the
macro
(you'll notice that I removed the line/command that copies the chart as a
picture. This is intentional.):

Sub ChartsToPresentation()
' Set a VBE reference to Microsoft PowerPoint Object Library

Dim PPApp As PowerPoint.Application
Dim PPPres As PowerPoint.Presentation
Dim PPSlide As PowerPoint.Slide
Dim PresentationFileName As Variant
Dim SlideCount As Long
Dim iCht As Integer

' Reference existing instance of PowerPoint
Set PPApp = GetObject(, "Powerpoint.Application")
' Reference active presentation
Set PPPres = PPApp.ActivePresentation
PPApp.ActiveWindow.ViewType = ppViewSlide

For iCht = 1 To ActiveSheet.ChartObjects.Count
' copy chart as a picture
ActiveSheet.ChartObjects(iCht).Copy

' Add a new slide and paste in the chart
SlideCount = PPPres.Slides.Count
Set PPSlide = PPPres.Slides.Add(SlideCount + 1, ppLayoutBlank)
PPApp.ActiveWindow.View.GotoSlide PPSlide.SlideIndex
With PPSlide
' paste and select the chart picture
.Shapes.Paste.Select
' align the chart
PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignCenters, True
PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignMiddles, True
End With

Next

' Clean up
Set PPSlide = Nothing
Set PPPres = Nothing
Set PPApp = Nothing

End Sub

Is there a way to output the charts to PowerPoint with the following
parameters:

Height 5.66 inches
Width 9.66 inches
Horizontal Position 0 inches from top left corner
Vertical Position 1 inch from top left corner

Many thanks in advance!


"Jon Peltier" wrote:



I suspect you didn't set the reference to PowerPoint. It's described
higher
on the page than the specific code you must have copied. Just under the
big
title "Activating Other Applications with Excel VBA".

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______

"mustang25" wrote in message
...


It amazes me to see the amount of knowledge stored on these forums.
I'm
seriously impressed that there is an answer to my question. Thank you
Jon.

Unfortunately, my VB skills are at about the same level as my 2 year
old
son's. In other words, I don't know the first thing about it. I
figured
out
how to paste the code into the VBE, but when I try to run the macro, I
get
an
error saying "User Type not Defined." I know this has to be a very
basic
issue, but like I said, I don't know the first thing about VB. Am I
better
off just copying and pasting my charts one at a time?

"Jon Peltier" wrote:



Partway through this article you'll find programmatic approaches to
that
very problem:

http://peltiertech.com/Excel/XL_PPT.html

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______

"mustang25" wrote in message
...


OK, I think I have a question that will stump even the best of you!
:)

I have several worksheets that contain multiple charts. I want to
copy
the
charts from Excel to PowerPoint with one chart to a slide. I can do
so
one
at a time by copying and pasting them. The drawback is that it
takes
lots
of
time to do this because I'm working with 250+ charts. My question
is
if
there is a way to quickly export the charts to PowerPoint so that
each
slide
contains a different chart.





--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info


--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
  #14   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 148
Default Multiple Excel Charts to PowerPoint

copy picture is already in the script.

"Andy Pope" wrote:

What if you use .CopyPicture instead

ActiveSheet.ChartObjects(iCht).CopyPicture


Danny wrote:
Andy,

Thanks. Turning the grid lines off\on via a macro is whjat I ended up
doing. I was just trying to find a more efficient way within the original
macro.

Project is done, but still thinking about the "better mouse trap"!

Danny

"Andy Pope" wrote:


Hi Danny,

Any reason why you can not turn the gridlines off and back on when your
macro is run?

Cheers
Andy

Danny wrote:

Jon,
Is there a way to bring the chart in as a picture (enhanced metafile)? In
my case, bringing the chart in as a picitre also brings in the excel grid
lines. Guess I could turn off the gridlines, but I really need them as the
spreadsheet is a template for others and I wwant to be able to have everyone
bring in the chart to pp in the same size, location, etc, but with their data.

Thanks,

Danny

"Jon Peltier" wrote:



In a different forum I answered one way, that you should make it in Excel so
that it comes out right in PowerPoint. I stick by that, but I'll answer the
other way as well. You can adjust this part of the code to handle resizing
of the chart.

With PPSlide
' paste and select the chart picture
.Shapes.Paste.Select
' align the chart
PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignCenters, True
PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignMiddles, True
End With

Instead of centering the chart, position and resize it:

With PPSlide
' paste and select the chart picture
.Shapes.Paste.Select
' position the chart
With PPApp.ActiveWindow.Selection.ShapeRange
.Top = 72 ' points
.Left = 0
.Width = 9.66 * 72
.Height = 5.66 * 72
End With
End With

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"mustang25" wrote in message
...


Jon,

This is working brilliantly. I'd like to throw one more challenge at you
if
you don't mind. It follows below. Here is the code I'm using for the
macro
(you'll notice that I removed the line/command that copies the chart as a
picture. This is intentional.):

Sub ChartsToPresentation()
' Set a VBE reference to Microsoft PowerPoint Object Library

Dim PPApp As PowerPoint.Application
Dim PPPres As PowerPoint.Presentation
Dim PPSlide As PowerPoint.Slide
Dim PresentationFileName As Variant
Dim SlideCount As Long
Dim iCht As Integer

' Reference existing instance of PowerPoint
Set PPApp = GetObject(, "Powerpoint.Application")
' Reference active presentation
Set PPPres = PPApp.ActivePresentation
PPApp.ActiveWindow.ViewType = ppViewSlide

For iCht = 1 To ActiveSheet.ChartObjects.Count
' copy chart as a picture
ActiveSheet.ChartObjects(iCht).Copy

' Add a new slide and paste in the chart
SlideCount = PPPres.Slides.Count
Set PPSlide = PPPres.Slides.Add(SlideCount + 1, ppLayoutBlank)
PPApp.ActiveWindow.View.GotoSlide PPSlide.SlideIndex
With PPSlide
' paste and select the chart picture
.Shapes.Paste.Select
' align the chart
PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignCenters, True
PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignMiddles, True
End With

Next

' Clean up
Set PPSlide = Nothing
Set PPPres = Nothing
Set PPApp = Nothing

End Sub

Is there a way to output the charts to PowerPoint with the following
parameters:

Height 5.66 inches
Width 9.66 inches
Horizontal Position 0 inches from top left corner
Vertical Position 1 inch from top left corner

Many thanks in advance!


"Jon Peltier" wrote:



I suspect you didn't set the reference to PowerPoint. It's described
higher
on the page than the specific code you must have copied. Just under the
big
title "Activating Other Applications with Excel VBA".

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______

"mustang25" wrote in message
...


It amazes me to see the amount of knowledge stored on these forums.
I'm
seriously impressed that there is an answer to my question. Thank you
Jon.

Unfortunately, my VB skills are at about the same level as my 2 year
old
son's. In other words, I don't know the first thing about it. I
figured
out
how to paste the code into the VBE, but when I try to run the macro, I
get
an
error saying "User Type not Defined." I know this has to be a very
basic
issue, but like I said, I don't know the first thing about VB. Am I
better
off just copying and pasting my charts one at a time?

"Jon Peltier" wrote:



Partway through this article you'll find programmatic approaches to
that
very problem:

http://peltiertech.com/Excel/XL_PPT.html

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______

"mustang25" wrote in message
...


OK, I think I have a question that will stump even the best of you!
:)

I have several worksheets that contain multiple charts. I want to
copy
the
charts from Excel to PowerPoint with one chart to a slide. I can do
so
one
at a time by copying and pasting them. The drawback is that it
takes
lots
of
time to do this because I'm working with 250+ charts. My question
is
if
there is a way to quickly export the charts to PowerPoint so that
each
slide
contains a different chart.





--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info


--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info

  #15   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 6,582
Default Multiple Excel Charts to PowerPoint

If you are copying the chart as a picture, you will see none of the
worksheet beneath. If instead you copy a range that has the chart over it,
then you will see the chart and whatever part of the range hangs out beyond
the boundaries of the chart.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"Danny" wrote in message
...
Jon,
Is there a way to bring the chart in as a picture (enhanced metafile)? In
my case, bringing the chart in as a picitre also brings in the excel grid
lines. Guess I could turn off the gridlines, but I really need them as
the
spreadsheet is a template for others and I wwant to be able to have
everyone
bring in the chart to pp in the same size, location, etc, but with their
data.

Thanks,

Danny

"Jon Peltier" wrote:

In a different forum I answered one way, that you should make it in Excel
so
that it comes out right in PowerPoint. I stick by that, but I'll answer
the
other way as well. You can adjust this part of the code to handle
resizing
of the chart.

With PPSlide
' paste and select the chart picture
.Shapes.Paste.Select
' align the chart
PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignCenters,
True
PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignMiddles,
True
End With

Instead of centering the chart, position and resize it:

With PPSlide
' paste and select the chart picture
.Shapes.Paste.Select
' position the chart
With PPApp.ActiveWindow.Selection.ShapeRange
.Top = 72 ' points
.Left = 0
.Width = 9.66 * 72
.Height = 5.66 * 72
End With
End With

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"mustang25" wrote in message
...
Jon,

This is working brilliantly. I'd like to throw one more challenge at
you
if
you don't mind. It follows below. Here is the code I'm using for the
macro
(you'll notice that I removed the line/command that copies the chart as
a
picture. This is intentional.):

Sub ChartsToPresentation()
' Set a VBE reference to Microsoft PowerPoint Object Library

Dim PPApp As PowerPoint.Application
Dim PPPres As PowerPoint.Presentation
Dim PPSlide As PowerPoint.Slide
Dim PresentationFileName As Variant
Dim SlideCount As Long
Dim iCht As Integer

' Reference existing instance of PowerPoint
Set PPApp = GetObject(, "Powerpoint.Application")
' Reference active presentation
Set PPPres = PPApp.ActivePresentation
PPApp.ActiveWindow.ViewType = ppViewSlide

For iCht = 1 To ActiveSheet.ChartObjects.Count
' copy chart as a picture
ActiveSheet.ChartObjects(iCht).Copy

' Add a new slide and paste in the chart
SlideCount = PPPres.Slides.Count
Set PPSlide = PPPres.Slides.Add(SlideCount + 1, ppLayoutBlank)
PPApp.ActiveWindow.View.GotoSlide PPSlide.SlideIndex
With PPSlide
' paste and select the chart picture
.Shapes.Paste.Select
' align the chart
PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignCenters,
True
PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignMiddles,
True
End With

Next

' Clean up
Set PPSlide = Nothing
Set PPPres = Nothing
Set PPApp = Nothing

End Sub

Is there a way to output the charts to PowerPoint with the following
parameters:

Height 5.66 inches
Width 9.66 inches
Horizontal Position 0 inches from top left corner
Vertical Position 1 inch from top left corner

Many thanks in advance!


"Jon Peltier" wrote:

I suspect you didn't set the reference to PowerPoint. It's described
higher
on the page than the specific code you must have copied. Just under
the
big
title "Activating Other Applications with Excel VBA".

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______

"mustang25" wrote in message
...
It amazes me to see the amount of knowledge stored on these forums.
I'm
seriously impressed that there is an answer to my question. Thank
you
Jon.

Unfortunately, my VB skills are at about the same level as my 2 year
old
son's. In other words, I don't know the first thing about it. I
figured
out
how to paste the code into the VBE, but when I try to run the macro,
I
get
an
error saying "User Type not Defined." I know this has to be a very
basic
issue, but like I said, I don't know the first thing about VB. Am I
better
off just copying and pasting my charts one at a time?

"Jon Peltier" wrote:

Partway through this article you'll find programmatic approaches to
that
very problem:

http://peltiertech.com/Excel/XL_PPT.html

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______

"mustang25" wrote in message
...
OK, I think I have a question that will stump even the best of
you!
:)

I have several worksheets that contain multiple charts. I want
to
copy
the
charts from Excel to PowerPoint with one chart to a slide. I can
do
so
one
at a time by copying and pasting them. The drawback is that it
takes
lots
of
time to do this because I'm working with 250+ charts. My
question
is
if
there is a way to quickly export the charts to PowerPoint so that
each
slide
contains a different chart.













  #16   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 148
Default Multiple Excel Charts to PowerPoint

Jon,

My bad as I called my excel spreadsheet a chart when it is a spreadsheet.
Unless I am missing the boat, to copy a spreadsheet the range must be
selected.

Danny

"Jon Peltier" wrote:

If you are copying the chart as a picture, you will see none of the
worksheet beneath. If instead you copy a range that has the chart over it,
then you will see the chart and whatever part of the range hangs out beyond
the boundaries of the chart.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"Danny" wrote in message
...
Jon,
Is there a way to bring the chart in as a picture (enhanced metafile)? In
my case, bringing the chart in as a picitre also brings in the excel grid
lines. Guess I could turn off the gridlines, but I really need them as
the
spreadsheet is a template for others and I wwant to be able to have
everyone
bring in the chart to pp in the same size, location, etc, but with their
data.

Thanks,

Danny

"Jon Peltier" wrote:

In a different forum I answered one way, that you should make it in Excel
so
that it comes out right in PowerPoint. I stick by that, but I'll answer
the
other way as well. You can adjust this part of the code to handle
resizing
of the chart.

With PPSlide
' paste and select the chart picture
.Shapes.Paste.Select
' align the chart
PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignCenters,
True
PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignMiddles,
True
End With

Instead of centering the chart, position and resize it:

With PPSlide
' paste and select the chart picture
.Shapes.Paste.Select
' position the chart
With PPApp.ActiveWindow.Selection.ShapeRange
.Top = 72 ' points
.Left = 0
.Width = 9.66 * 72
.Height = 5.66 * 72
End With
End With

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"mustang25" wrote in message
...
Jon,

This is working brilliantly. I'd like to throw one more challenge at
you
if
you don't mind. It follows below. Here is the code I'm using for the
macro
(you'll notice that I removed the line/command that copies the chart as
a
picture. This is intentional.):

Sub ChartsToPresentation()
' Set a VBE reference to Microsoft PowerPoint Object Library

Dim PPApp As PowerPoint.Application
Dim PPPres As PowerPoint.Presentation
Dim PPSlide As PowerPoint.Slide
Dim PresentationFileName As Variant
Dim SlideCount As Long
Dim iCht As Integer

' Reference existing instance of PowerPoint
Set PPApp = GetObject(, "Powerpoint.Application")
' Reference active presentation
Set PPPres = PPApp.ActivePresentation
PPApp.ActiveWindow.ViewType = ppViewSlide

For iCht = 1 To ActiveSheet.ChartObjects.Count
' copy chart as a picture
ActiveSheet.ChartObjects(iCht).Copy

' Add a new slide and paste in the chart
SlideCount = PPPres.Slides.Count
Set PPSlide = PPPres.Slides.Add(SlideCount + 1, ppLayoutBlank)
PPApp.ActiveWindow.View.GotoSlide PPSlide.SlideIndex
With PPSlide
' paste and select the chart picture
.Shapes.Paste.Select
' align the chart
PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignCenters,
True
PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignMiddles,
True
End With

Next

' Clean up
Set PPSlide = Nothing
Set PPPres = Nothing
Set PPApp = Nothing

End Sub

Is there a way to output the charts to PowerPoint with the following
parameters:

Height 5.66 inches
Width 9.66 inches
Horizontal Position 0 inches from top left corner
Vertical Position 1 inch from top left corner

Many thanks in advance!


"Jon Peltier" wrote:

I suspect you didn't set the reference to PowerPoint. It's described
higher
on the page than the specific code you must have copied. Just under
the
big
title "Activating Other Applications with Excel VBA".

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______

"mustang25" wrote in message
...
It amazes me to see the amount of knowledge stored on these forums.
I'm
seriously impressed that there is an answer to my question. Thank
you
Jon.

Unfortunately, my VB skills are at about the same level as my 2 year
old
son's. In other words, I don't know the first thing about it. I
figured
out
how to paste the code into the VBE, but when I try to run the macro,
I
get
an
error saying "User Type not Defined." I know this has to be a very
basic
issue, but like I said, I don't know the first thing about VB. Am I
better
off just copying and pasting my charts one at a time?

"Jon Peltier" wrote:

Partway through this article you'll find programmatic approaches to
that
very problem:

http://peltiertech.com/Excel/XL_PPT.html

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______

"mustang25" wrote in message
...
OK, I think I have a question that will stump even the best of
you!
:)

I have several worksheets that contain multiple charts. I want
to
copy
the
charts from Excel to PowerPoint with one chart to a slide. I can
do
so
one
at a time by copying and pasting them. The drawback is that it
takes
lots
of
time to do this because I'm working with 250+ charts. My
question
is
if
there is a way to quickly export the charts to PowerPoint so that
each
slide
contains a different chart.












  #17   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 6,582
Default Multiple Excel Charts to PowerPoint

Are you copying a chart, or a worksheet range? If you just want the chart,
you can copy just the chart. There are several code examples on this page:

http://peltiertech.com/Excel/XL_PPT.html

Look for the "Copying as a Picture Within Excel" heading a few screens down
from the top of the page.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"Danny" wrote in message
...
Jon,

My bad as I called my excel spreadsheet a chart when it is a spreadsheet.
Unless I am missing the boat, to copy a spreadsheet the range must be
selected.

Danny

"Jon Peltier" wrote:

If you are copying the chart as a picture, you will see none of the
worksheet beneath. If instead you copy a range that has the chart over
it,
then you will see the chart and whatever part of the range hangs out
beyond
the boundaries of the chart.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"Danny" wrote in message
...
Jon,
Is there a way to bring the chart in as a picture (enhanced metafile)?
In
my case, bringing the chart in as a picitre also brings in the excel
grid
lines. Guess I could turn off the gridlines, but I really need them as
the
spreadsheet is a template for others and I wwant to be able to have
everyone
bring in the chart to pp in the same size, location, etc, but with
their
data.

Thanks,

Danny

"Jon Peltier" wrote:

In a different forum I answered one way, that you should make it in
Excel
so
that it comes out right in PowerPoint. I stick by that, but I'll
answer
the
other way as well. You can adjust this part of the code to handle
resizing
of the chart.

With PPSlide
' paste and select the chart picture
.Shapes.Paste.Select
' align the chart
PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignCenters,
True
PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignMiddles,
True
End With

Instead of centering the chart, position and resize it:

With PPSlide
' paste and select the chart picture
.Shapes.Paste.Select
' position the chart
With PPApp.ActiveWindow.Selection.ShapeRange
.Top = 72 ' points
.Left = 0
.Width = 9.66 * 72
.Height = 5.66 * 72
End With
End With

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"mustang25" wrote in message
...
Jon,

This is working brilliantly. I'd like to throw one more challenge
at
you
if
you don't mind. It follows below. Here is the code I'm using for
the
macro
(you'll notice that I removed the line/command that copies the chart
as
a
picture. This is intentional.):

Sub ChartsToPresentation()
' Set a VBE reference to Microsoft PowerPoint Object Library

Dim PPApp As PowerPoint.Application
Dim PPPres As PowerPoint.Presentation
Dim PPSlide As PowerPoint.Slide
Dim PresentationFileName As Variant
Dim SlideCount As Long
Dim iCht As Integer

' Reference existing instance of PowerPoint
Set PPApp = GetObject(, "Powerpoint.Application")
' Reference active presentation
Set PPPres = PPApp.ActivePresentation
PPApp.ActiveWindow.ViewType = ppViewSlide

For iCht = 1 To ActiveSheet.ChartObjects.Count
' copy chart as a picture
ActiveSheet.ChartObjects(iCht).Copy

' Add a new slide and paste in the chart
SlideCount = PPPres.Slides.Count
Set PPSlide = PPPres.Slides.Add(SlideCount + 1, ppLayoutBlank)
PPApp.ActiveWindow.View.GotoSlide PPSlide.SlideIndex
With PPSlide
' paste and select the chart picture
.Shapes.Paste.Select
' align the chart
PPApp.ActiveWindow.Selection.ShapeRange.Align
msoAlignCenters,
True
PPApp.ActiveWindow.Selection.ShapeRange.Align
msoAlignMiddles,
True
End With

Next

' Clean up
Set PPSlide = Nothing
Set PPPres = Nothing
Set PPApp = Nothing

End Sub

Is there a way to output the charts to PowerPoint with the following
parameters:

Height 5.66 inches
Width 9.66 inches
Horizontal Position 0 inches from top left corner
Vertical Position 1 inch from top left corner

Many thanks in advance!


"Jon Peltier" wrote:

I suspect you didn't set the reference to PowerPoint. It's
described
higher
on the page than the specific code you must have copied. Just under
the
big
title "Activating Other Applications with Excel VBA".

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______

"mustang25" wrote in message
...
It amazes me to see the amount of knowledge stored on these
forums.
I'm
seriously impressed that there is an answer to my question.
Thank
you
Jon.

Unfortunately, my VB skills are at about the same level as my 2
year
old
son's. In other words, I don't know the first thing about it. I
figured
out
how to paste the code into the VBE, but when I try to run the
macro,
I
get
an
error saying "User Type not Defined." I know this has to be a
very
basic
issue, but like I said, I don't know the first thing about VB.
Am I
better
off just copying and pasting my charts one at a time?

"Jon Peltier" wrote:

Partway through this article you'll find programmatic approaches
to
that
very problem:

http://peltiertech.com/Excel/XL_PPT.html

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______

"mustang25" wrote in
message
...
OK, I think I have a question that will stump even the best of
you!
:)

I have several worksheets that contain multiple charts. I
want
to
copy
the
charts from Excel to PowerPoint with one chart to a slide. I
can
do
so
one
at a time by copying and pasting them. The drawback is that
it
takes
lots
of
time to do this because I'm working with 250+ charts. My
question
is
if
there is a way to quickly export the charts to PowerPoint so
that
each
slide
contains a different chart.














  #18   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 148
Default Multiple Excel Charts to PowerPoint

Jon,

Thanks again! Your link cleared every thing up. I never knew the copy
picture edit box existed for use in copying a range as a picute for insertion
into PP. I was trying to copy a range. Great tip!

Danny

"Jon Peltier" wrote:

Are you copying a chart, or a worksheet range? If you just want the chart,
you can copy just the chart. There are several code examples on this page:

http://peltiertech.com/Excel/XL_PPT.html

Look for the "Copying as a Picture Within Excel" heading a few screens down
from the top of the page.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"Danny" wrote in message
...
Jon,

My bad as I called my excel spreadsheet a chart when it is a spreadsheet.
Unless I am missing the boat, to copy a spreadsheet the range must be
selected.

Danny

"Jon Peltier" wrote:

If you are copying the chart as a picture, you will see none of the
worksheet beneath. If instead you copy a range that has the chart over
it,
then you will see the chart and whatever part of the range hangs out
beyond
the boundaries of the chart.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"Danny" wrote in message
...
Jon,
Is there a way to bring the chart in as a picture (enhanced metafile)?
In
my case, bringing the chart in as a picitre also brings in the excel
grid
lines. Guess I could turn off the gridlines, but I really need them as
the
spreadsheet is a template for others and I wwant to be able to have
everyone
bring in the chart to pp in the same size, location, etc, but with
their
data.

Thanks,

Danny

"Jon Peltier" wrote:

In a different forum I answered one way, that you should make it in
Excel
so
that it comes out right in PowerPoint. I stick by that, but I'll
answer
the
other way as well. You can adjust this part of the code to handle
resizing
of the chart.

With PPSlide
' paste and select the chart picture
.Shapes.Paste.Select
' align the chart
PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignCenters,
True
PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignMiddles,
True
End With

Instead of centering the chart, position and resize it:

With PPSlide
' paste and select the chart picture
.Shapes.Paste.Select
' position the chart
With PPApp.ActiveWindow.Selection.ShapeRange
.Top = 72 ' points
.Left = 0
.Width = 9.66 * 72
.Height = 5.66 * 72
End With
End With

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"mustang25" wrote in message
...
Jon,

This is working brilliantly. I'd like to throw one more challenge
at
you
if
you don't mind. It follows below. Here is the code I'm using for
the
macro
(you'll notice that I removed the line/command that copies the chart
as
a
picture. This is intentional.):

Sub ChartsToPresentation()
' Set a VBE reference to Microsoft PowerPoint Object Library

Dim PPApp As PowerPoint.Application
Dim PPPres As PowerPoint.Presentation
Dim PPSlide As PowerPoint.Slide
Dim PresentationFileName As Variant
Dim SlideCount As Long
Dim iCht As Integer

' Reference existing instance of PowerPoint
Set PPApp = GetObject(, "Powerpoint.Application")
' Reference active presentation
Set PPPres = PPApp.ActivePresentation
PPApp.ActiveWindow.ViewType = ppViewSlide

For iCht = 1 To ActiveSheet.ChartObjects.Count
' copy chart as a picture
ActiveSheet.ChartObjects(iCht).Copy

' Add a new slide and paste in the chart
SlideCount = PPPres.Slides.Count
Set PPSlide = PPPres.Slides.Add(SlideCount + 1, ppLayoutBlank)
PPApp.ActiveWindow.View.GotoSlide PPSlide.SlideIndex
With PPSlide
' paste and select the chart picture
.Shapes.Paste.Select
' align the chart
PPApp.ActiveWindow.Selection.ShapeRange.Align
msoAlignCenters,
True
PPApp.ActiveWindow.Selection.ShapeRange.Align
msoAlignMiddles,
True
End With

Next

' Clean up
Set PPSlide = Nothing
Set PPPres = Nothing
Set PPApp = Nothing

End Sub

Is there a way to output the charts to PowerPoint with the following
parameters:

Height 5.66 inches
Width 9.66 inches
Horizontal Position 0 inches from top left corner
Vertical Position 1 inch from top left corner

Many thanks in advance!


"Jon Peltier" wrote:

I suspect you didn't set the reference to PowerPoint. It's
described
higher
on the page than the specific code you must have copied. Just under
the
big
title "Activating Other Applications with Excel VBA".

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______

"mustang25" wrote in message
...
It amazes me to see the amount of knowledge stored on these
forums.
I'm
seriously impressed that there is an answer to my question.
Thank
you
Jon.

Unfortunately, my VB skills are at about the same level as my 2
year
old
son's. In other words, I don't know the first thing about it. I
figured
out
how to paste the code into the VBE, but when I try to run the
macro,
I
get
an
error saying "User Type not Defined." I know this has to be a
very
basic
issue, but like I said, I don't know the first thing about VB.
Am I
better
off just copying and pasting my charts one at a time?

"Jon Peltier" wrote:

Partway through this article you'll find programmatic approaches
to
that
very problem:

http://peltiertech.com/Excel/XL_PPT.html

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______

"mustang25" wrote in
message
...
OK, I think I have a question that will stump even the best of
you!
:)

I have several worksheets that contain multiple charts. I
want
to
copy
the
charts from Excel to PowerPoint with one chart to a slide. I
can
do
so
one
at a time by copying and pasting them. The drawback is that
it
takes
lots
of
time to do this because I'm working with 250+ charts. My
question
is
if
there is a way to quickly export the charts to PowerPoint so
that
each
slide
contains a different chart.















  #19   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 5
Default Multiple Excel Charts to PowerPoint

Jon,

I've tried to find that other forum in which you said how to set the desired
chart size right in Excel, but can't. Please let me know which one it is.

Thanks.


"Jon Peltier" wrote:

In a different forum I answered one way, that you should make it in Excel so
that it comes out right in PowerPoint. I stick by that, but I'll answer the
other way as well. You can adjust this part of the code to handle resizing
of the chart.

With PPSlide
' paste and select the chart picture
.Shapes.Paste.Select
' align the chart
PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignCenters, True
PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignMiddles, True
End With

Instead of centering the chart, position and resize it:

With PPSlide
' paste and select the chart picture
.Shapes.Paste.Select
' position the chart
With PPApp.ActiveWindow.Selection.ShapeRange
.Top = 72 ' points
.Left = 0
.Width = 9.66 * 72
.Height = 5.66 * 72
End With
End With

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"mustang25" wrote in message
...
Jon,

This is working brilliantly. I'd like to throw one more challenge at you
if
you don't mind. It follows below. Here is the code I'm using for the
macro
(you'll notice that I removed the line/command that copies the chart as a
picture. This is intentional.):

Sub ChartsToPresentation()
' Set a VBE reference to Microsoft PowerPoint Object Library

Dim PPApp As PowerPoint.Application
Dim PPPres As PowerPoint.Presentation
Dim PPSlide As PowerPoint.Slide
Dim PresentationFileName As Variant
Dim SlideCount As Long
Dim iCht As Integer

' Reference existing instance of PowerPoint
Set PPApp = GetObject(, "Powerpoint.Application")
' Reference active presentation
Set PPPres = PPApp.ActivePresentation
PPApp.ActiveWindow.ViewType = ppViewSlide

For iCht = 1 To ActiveSheet.ChartObjects.Count
' copy chart as a picture
ActiveSheet.ChartObjects(iCht).Copy

' Add a new slide and paste in the chart
SlideCount = PPPres.Slides.Count
Set PPSlide = PPPres.Slides.Add(SlideCount + 1, ppLayoutBlank)
PPApp.ActiveWindow.View.GotoSlide PPSlide.SlideIndex
With PPSlide
' paste and select the chart picture
.Shapes.Paste.Select
' align the chart
PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignCenters, True
PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignMiddles, True
End With

Next

' Clean up
Set PPSlide = Nothing
Set PPPres = Nothing
Set PPApp = Nothing

End Sub

Is there a way to output the charts to PowerPoint with the following
parameters:

Height 5.66 inches
Width 9.66 inches
Horizontal Position 0 inches from top left corner
Vertical Position 1 inch from top left corner

Many thanks in advance!


"Jon Peltier" wrote:

I suspect you didn't set the reference to PowerPoint. It's described
higher
on the page than the specific code you must have copied. Just under the
big
title "Activating Other Applications with Excel VBA".

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______

"mustang25" wrote in message
...
It amazes me to see the amount of knowledge stored on these forums.
I'm
seriously impressed that there is an answer to my question. Thank you
Jon.

Unfortunately, my VB skills are at about the same level as my 2 year
old
son's. In other words, I don't know the first thing about it. I
figured
out
how to paste the code into the VBE, but when I try to run the macro, I
get
an
error saying "User Type not Defined." I know this has to be a very
basic
issue, but like I said, I don't know the first thing about VB. Am I
better
off just copying and pasting my charts one at a time?

"Jon Peltier" wrote:

Partway through this article you'll find programmatic approaches to
that
very problem:

http://peltiertech.com/Excel/XL_PPT.html

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______

"mustang25" wrote in message
...
OK, I think I have a question that will stump even the best of you!
:)

I have several worksheets that contain multiple charts. I want to
copy
the
charts from Excel to PowerPoint with one chart to a slide. I can do
so
one
at a time by copying and pasting them. The drawback is that it
takes
lots
of
time to do this because I'm working with 250+ charts. My question
is
if
there is a way to quickly export the charts to PowerPoint so that
each
slide
contains a different chart.









  #20   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 6,582
Default Multiple Excel Charts to PowerPoint

I don't recall now, and if I recalled then I'd probably have mentioned it.

To get back to your original question, you could adjust the pasted object's
size and position:

With PPSlide
' paste and select the chart picture
.Shapes.Paste.Select
' align the chart
With PPApp.ActiveWindow.Selection.ShapeRange.
.Top = [some value]
.Left = [some value]
.Height = [some value]
.Width = [some value]
End With


- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"My Own IT dept" wrote in message
...
Jon,

I've tried to find that other forum in which you said how to set the
desired
chart size right in Excel, but can't. Please let me know which one it is.

Thanks.


"Jon Peltier" wrote:

In a different forum I answered one way, that you should make it in Excel
so
that it comes out right in PowerPoint. I stick by that, but I'll answer
the
other way as well. You can adjust this part of the code to handle
resizing
of the chart.

With PPSlide
' paste and select the chart picture
.Shapes.Paste.Select
' align the chart
PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignCenters,
True
PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignMiddles,
True
End With

Instead of centering the chart, position and resize it:

With PPSlide
' paste and select the chart picture
.Shapes.Paste.Select
' position the chart
With PPApp.ActiveWindow.Selection.ShapeRange
.Top = 72 ' points
.Left = 0
.Width = 9.66 * 72
.Height = 5.66 * 72
End With
End With

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"mustang25" wrote in message
...
Jon,

This is working brilliantly. I'd like to throw one more challenge at
you
if
you don't mind. It follows below. Here is the code I'm using for the
macro
(you'll notice that I removed the line/command that copies the chart as
a
picture. This is intentional.):

Sub ChartsToPresentation()
' Set a VBE reference to Microsoft PowerPoint Object Library

Dim PPApp As PowerPoint.Application
Dim PPPres As PowerPoint.Presentation
Dim PPSlide As PowerPoint.Slide
Dim PresentationFileName As Variant
Dim SlideCount As Long
Dim iCht As Integer

' Reference existing instance of PowerPoint
Set PPApp = GetObject(, "Powerpoint.Application")
' Reference active presentation
Set PPPres = PPApp.ActivePresentation
PPApp.ActiveWindow.ViewType = ppViewSlide

For iCht = 1 To ActiveSheet.ChartObjects.Count
' copy chart as a picture
ActiveSheet.ChartObjects(iCht).Copy

' Add a new slide and paste in the chart
SlideCount = PPPres.Slides.Count
Set PPSlide = PPPres.Slides.Add(SlideCount + 1, ppLayoutBlank)
PPApp.ActiveWindow.View.GotoSlide PPSlide.SlideIndex
With PPSlide
' paste and select the chart picture
.Shapes.Paste.Select
' align the chart
PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignCenters,
True
PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignMiddles,
True
End With

Next

' Clean up
Set PPSlide = Nothing
Set PPPres = Nothing
Set PPApp = Nothing

End Sub

Is there a way to output the charts to PowerPoint with the following
parameters:

Height 5.66 inches
Width 9.66 inches
Horizontal Position 0 inches from top left corner
Vertical Position 1 inch from top left corner

Many thanks in advance!


"Jon Peltier" wrote:

I suspect you didn't set the reference to PowerPoint. It's described
higher
on the page than the specific code you must have copied. Just under
the
big
title "Activating Other Applications with Excel VBA".

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______

"mustang25" wrote in message
...
It amazes me to see the amount of knowledge stored on these forums.
I'm
seriously impressed that there is an answer to my question. Thank
you
Jon.

Unfortunately, my VB skills are at about the same level as my 2 year
old
son's. In other words, I don't know the first thing about it. I
figured
out
how to paste the code into the VBE, but when I try to run the macro,
I
get
an
error saying "User Type not Defined." I know this has to be a very
basic
issue, but like I said, I don't know the first thing about VB. Am I
better
off just copying and pasting my charts one at a time?

"Jon Peltier" wrote:

Partway through this article you'll find programmatic approaches to
that
very problem:

http://peltiertech.com/Excel/XL_PPT.html

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______

"mustang25" wrote in message
...
OK, I think I have a question that will stump even the best of
you!
:)

I have several worksheets that contain multiple charts. I want
to
copy
the
charts from Excel to PowerPoint with one chart to a slide. I can
do
so
one
at a time by copying and pasting them. The drawback is that it
takes
lots
of
time to do this because I'm working with 250+ charts. My
question
is
if
there is a way to quickly export the charts to PowerPoint so that
each
slide
contains a different chart.













  #21   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 5
Default Multiple Excel Charts to PowerPoint

Jon,

First let me say that I am a complete novice when it comes to using VBE. I
feel as if I'm in another counrty, don't understand the language and am using
hand gestures and grunting to try to get my problem solved. I'm missing some
basic understanding of how this whole system works. That said...

I'm trying to copy multiple charts (1 per worksheet) from a range of
worksheets.
I highlight the range of WS tabs and run the macro (F5). I get no error
message but nothing happens (no charts copied). I have a PPT document open
with more than enough blank pages (although I don't think that's necessary
based on what I think I read in the code).

Is there something else I should be doing?

Here is the code that I entered into the VBE editor (should look very
familiar):

Sub ChartstoPresentation()
' Set a VBE reference to Microsoft PowerPoint Object Library

Dim PPApp As PowerPoint.Application
Dim PPPres As PowerPoint.Presentation
Dim PPSlide As PowerPoint.Slide
Dim PresentationFileName As Variant
Dim SlideCount As Long
Dim iCht As Integer

' Reference existing instance of PowerPoint
Set PPApp = GetObject(, "Powerpoint.Application")
' Reference active presentation
Set PPPres = PPApp.ActivePresentation
PPApp.ActiveWindow.ViewType = ppViewSlide

For iCht = 1 To ActiveSheet.ChartObjects.Count
' copy chart as a picture
ActiveSheet.ChartObjects(iCht).Chart.CopyPicture _
Appearance:=xlScreen, Size:=xlScreen, Format:=xlPicture

' Add a new slide and paste in the chart
SlideCount = PPPres.Slides.Count
Set PPSlide = PPPres.Slides.Add(SlideCount + 1, ppLayoutBlank)
PPApp.ActiveWindow.View.GotoSlide PPSlide.SlideIndex
With PPSlide
' paste and select the chart picture
.Shapes.Paste.Select
' position the chart
With PPApp.ActiveWindow.Selection.ShapeRange
.Top = 94 ' points
.Left = 58 ' points
.Width = 8.2 * 72
.Height = 5.6 * 72
End With
End With

Next

' Clean up
Set PPSlide = Nothing
Set PPPres = Nothing
Set PPApp = Nothing

End Sub

-----

Any suggestions?

Thanks very much.


"Jon Peltier" wrote:

I don't recall now, and if I recalled then I'd probably have mentioned it.

To get back to your original question, you could adjust the pasted object's
size and position:

With PPSlide
' paste and select the chart picture
.Shapes.Paste.Select
' align the chart
With PPApp.ActiveWindow.Selection.ShapeRange.
.Top = [some value]
.Left = [some value]
.Height = [some value]
.Width = [some value]
End With


- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"My Own IT dept" wrote in message
...
Jon,

I've tried to find that other forum in which you said how to set the
desired
chart size right in Excel, but can't. Please let me know which one it is.

Thanks.


"Jon Peltier" wrote:

In a different forum I answered one way, that you should make it in Excel
so
that it comes out right in PowerPoint. I stick by that, but I'll answer
the
other way as well. You can adjust this part of the code to handle
resizing
of the chart.

With PPSlide
' paste and select the chart picture
.Shapes.Paste.Select
' align the chart
PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignCenters,
True
PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignMiddles,
True
End With

Instead of centering the chart, position and resize it:

With PPSlide
' paste and select the chart picture
.Shapes.Paste.Select
' position the chart
With PPApp.ActiveWindow.Selection.ShapeRange
.Top = 72 ' points
.Left = 0
.Width = 9.66 * 72
.Height = 5.66 * 72
End With
End With

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"mustang25" wrote in message
...
Jon,

This is working brilliantly. I'd like to throw one more challenge at
you
if
you don't mind. It follows below. Here is the code I'm using for the
macro
(you'll notice that I removed the line/command that copies the chart as
a
picture. This is intentional.):

Sub ChartsToPresentation()
' Set a VBE reference to Microsoft PowerPoint Object Library

Dim PPApp As PowerPoint.Application
Dim PPPres As PowerPoint.Presentation
Dim PPSlide As PowerPoint.Slide
Dim PresentationFileName As Variant
Dim SlideCount As Long
Dim iCht As Integer

' Reference existing instance of PowerPoint
Set PPApp = GetObject(, "Powerpoint.Application")
' Reference active presentation
Set PPPres = PPApp.ActivePresentation
PPApp.ActiveWindow.ViewType = ppViewSlide

For iCht = 1 To ActiveSheet.ChartObjects.Count
' copy chart as a picture
ActiveSheet.ChartObjects(iCht).Copy

' Add a new slide and paste in the chart
SlideCount = PPPres.Slides.Count
Set PPSlide = PPPres.Slides.Add(SlideCount + 1, ppLayoutBlank)
PPApp.ActiveWindow.View.GotoSlide PPSlide.SlideIndex
With PPSlide
' paste and select the chart picture
.Shapes.Paste.Select
' align the chart
PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignCenters,
True
PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignMiddles,
True
End With

Next

' Clean up
Set PPSlide = Nothing
Set PPPres = Nothing
Set PPApp = Nothing

End Sub

Is there a way to output the charts to PowerPoint with the following
parameters:

Height 5.66 inches
Width 9.66 inches
Horizontal Position 0 inches from top left corner
Vertical Position 1 inch from top left corner

Many thanks in advance!


"Jon Peltier" wrote:

I suspect you didn't set the reference to PowerPoint. It's described
higher
on the page than the specific code you must have copied. Just under
the
big
title "Activating Other Applications with Excel VBA".

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______

"mustang25" wrote in message
...
It amazes me to see the amount of knowledge stored on these forums.
I'm
seriously impressed that there is an answer to my question. Thank
you
Jon.

Unfortunately, my VB skills are at about the same level as my 2 year
old
son's. In other words, I don't know the first thing about it. I
figured
out
how to paste the code into the VBE, but when I try to run the macro,
I
get
an
error saying "User Type not Defined." I know this has to be a very
basic
issue, but like I said, I don't know the first thing about VB. Am I
better
off just copying and pasting my charts one at a time?

"Jon Peltier" wrote:

Partway through this article you'll find programmatic approaches to
that
very problem:

http://peltiertech.com/Excel/XL_PPT.html

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______

"mustang25" wrote in message
...
OK, I think I have a question that will stump even the best of
you!
:)

I have several worksheets that contain multiple charts. I want
to
copy
the
charts from Excel to PowerPoint with one chart to a slide. I can
do
so
one
at a time by copying and pasting them. The drawback is that it
takes
lots
of
time to do this because I'm working with 250+ charts. My
question
is
if
there is a way to quickly export the charts to PowerPoint so that
each
slide
contains a different chart.












  #22   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 6,582
Default Multiple Excel Charts to PowerPoint

The code you've posted copies all chart objects embedded in the active sheet
to a new PowerPoint slide.

To change to copying chart sheets, replace these lines

For iCht = 1 To ActiveSheet.ChartObjects.Count
' copy chart as a picture
ActiveSheet.ChartObjects(iCht).Chart.CopyPicture _
Appearance:=xlScreen, Size:=xlScreen, Format:=xlPicture

with these lines

For iCht = 1 To ActiveWorkbook.Charts.Count
' copy chart as a picture
ActiveWorkbook.Charts(iCht).CopyPicture _
Appearance:=xlScreen, Size:=xlScreen, Format:=xlPicture

This will copy every chart sheet to its own slide.

If you have one chart embedded in each worksheet, you can try this
variation:

For iCht = 1 To ActiveWorkbook.Worksheets.Count
' copy chart as a picture
ActiveWorkbook.Worksheets(iCht).ChartObjects(1).Ch art.CopyPicture _
Appearance:=xlScreen, Size:=xlScreen, Format:=xlPicture


- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"My Own IT dept" wrote in message
...
Jon,

First let me say that I am a complete novice when it comes to using VBE.
I
feel as if I'm in another counrty, don't understand the language and am
using
hand gestures and grunting to try to get my problem solved. I'm missing
some
basic understanding of how this whole system works. That said...

I'm trying to copy multiple charts (1 per worksheet) from a range of
worksheets.
I highlight the range of WS tabs and run the macro (F5). I get no error
message but nothing happens (no charts copied). I have a PPT document
open
with more than enough blank pages (although I don't think that's necessary
based on what I think I read in the code).

Is there something else I should be doing?

Here is the code that I entered into the VBE editor (should look very
familiar):

Sub ChartstoPresentation()
' Set a VBE reference to Microsoft PowerPoint Object Library

Dim PPApp As PowerPoint.Application
Dim PPPres As PowerPoint.Presentation
Dim PPSlide As PowerPoint.Slide
Dim PresentationFileName As Variant
Dim SlideCount As Long
Dim iCht As Integer

' Reference existing instance of PowerPoint
Set PPApp = GetObject(, "Powerpoint.Application")
' Reference active presentation
Set PPPres = PPApp.ActivePresentation
PPApp.ActiveWindow.ViewType = ppViewSlide

For iCht = 1 To ActiveSheet.ChartObjects.Count
' copy chart as a picture
ActiveSheet.ChartObjects(iCht).Chart.CopyPicture _
Appearance:=xlScreen, Size:=xlScreen, Format:=xlPicture

' Add a new slide and paste in the chart
SlideCount = PPPres.Slides.Count
Set PPSlide = PPPres.Slides.Add(SlideCount + 1, ppLayoutBlank)
PPApp.ActiveWindow.View.GotoSlide PPSlide.SlideIndex
With PPSlide
' paste and select the chart picture
.Shapes.Paste.Select
' position the chart
With PPApp.ActiveWindow.Selection.ShapeRange
.Top = 94 ' points
.Left = 58 ' points
.Width = 8.2 * 72
.Height = 5.6 * 72
End With
End With

Next

' Clean up
Set PPSlide = Nothing
Set PPPres = Nothing
Set PPApp = Nothing

End Sub

-----

Any suggestions?

Thanks very much.


"Jon Peltier" wrote:

I don't recall now, and if I recalled then I'd probably have mentioned
it.

To get back to your original question, you could adjust the pasted
object's
size and position:

With PPSlide
' paste and select the chart picture
.Shapes.Paste.Select
' align the chart
With PPApp.ActiveWindow.Selection.ShapeRange.
.Top = [some value]
.Left = [some value]
.Height = [some value]
.Width = [some value]
End With


- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"My Own IT dept" wrote in message
...
Jon,

I've tried to find that other forum in which you said how to set the
desired
chart size right in Excel, but can't. Please let me know which one it
is.

Thanks.


"Jon Peltier" wrote:

In a different forum I answered one way, that you should make it in
Excel
so
that it comes out right in PowerPoint. I stick by that, but I'll
answer
the
other way as well. You can adjust this part of the code to handle
resizing
of the chart.

With PPSlide
' paste and select the chart picture
.Shapes.Paste.Select
' align the chart
PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignCenters,
True
PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignMiddles,
True
End With

Instead of centering the chart, position and resize it:

With PPSlide
' paste and select the chart picture
.Shapes.Paste.Select
' position the chart
With PPApp.ActiveWindow.Selection.ShapeRange
.Top = 72 ' points
.Left = 0
.Width = 9.66 * 72
.Height = 5.66 * 72
End With
End With

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"mustang25" wrote in message
...
Jon,

This is working brilliantly. I'd like to throw one more challenge
at
you
if
you don't mind. It follows below. Here is the code I'm using for
the
macro
(you'll notice that I removed the line/command that copies the chart
as
a
picture. This is intentional.):

Sub ChartsToPresentation()
' Set a VBE reference to Microsoft PowerPoint Object Library

Dim PPApp As PowerPoint.Application
Dim PPPres As PowerPoint.Presentation
Dim PPSlide As PowerPoint.Slide
Dim PresentationFileName As Variant
Dim SlideCount As Long
Dim iCht As Integer

' Reference existing instance of PowerPoint
Set PPApp = GetObject(, "Powerpoint.Application")
' Reference active presentation
Set PPPres = PPApp.ActivePresentation
PPApp.ActiveWindow.ViewType = ppViewSlide

For iCht = 1 To ActiveSheet.ChartObjects.Count
' copy chart as a picture
ActiveSheet.ChartObjects(iCht).Copy

' Add a new slide and paste in the chart
SlideCount = PPPres.Slides.Count
Set PPSlide = PPPres.Slides.Add(SlideCount + 1, ppLayoutBlank)
PPApp.ActiveWindow.View.GotoSlide PPSlide.SlideIndex
With PPSlide
' paste and select the chart picture
.Shapes.Paste.Select
' align the chart
PPApp.ActiveWindow.Selection.ShapeRange.Align
msoAlignCenters,
True
PPApp.ActiveWindow.Selection.ShapeRange.Align
msoAlignMiddles,
True
End With

Next

' Clean up
Set PPSlide = Nothing
Set PPPres = Nothing
Set PPApp = Nothing

End Sub

Is there a way to output the charts to PowerPoint with the following
parameters:

Height 5.66 inches
Width 9.66 inches
Horizontal Position 0 inches from top left corner
Vertical Position 1 inch from top left corner

Many thanks in advance!


"Jon Peltier" wrote:

I suspect you didn't set the reference to PowerPoint. It's
described
higher
on the page than the specific code you must have copied. Just under
the
big
title "Activating Other Applications with Excel VBA".

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______

"mustang25" wrote in message
...
It amazes me to see the amount of knowledge stored on these
forums.
I'm
seriously impressed that there is an answer to my question.
Thank
you
Jon.

Unfortunately, my VB skills are at about the same level as my 2
year
old
son's. In other words, I don't know the first thing about it. I
figured
out
how to paste the code into the VBE, but when I try to run the
macro,
I
get
an
error saying "User Type not Defined." I know this has to be a
very
basic
issue, but like I said, I don't know the first thing about VB.
Am I
better
off just copying and pasting my charts one at a time?

"Jon Peltier" wrote:

Partway through this article you'll find programmatic approaches
to
that
very problem:

http://peltiertech.com/Excel/XL_PPT.html

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______

"mustang25" wrote in
message
...
OK, I think I have a question that will stump even the best of
you!
:)

I have several worksheets that contain multiple charts. I
want
to
copy
the
charts from Excel to PowerPoint with one chart to a slide. I
can
do
so
one
at a time by copying and pasting them. The drawback is that
it
takes
lots
of
time to do this because I'm working with 250+ charts. My
question
is
if
there is a way to quickly export the charts to PowerPoint so
that
each
slide
contains a different chart.














  #23   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 5
Default Multiple Excel Charts to PowerPoint

Outstanding!! Thank you, Jon!

For those of us who fight the IT battle alone you guys are a lifeline.

Mitch

"Jon Peltier" wrote:

The code you've posted copies all chart objects embedded in the active sheet
to a new PowerPoint slide.

To change to copying chart sheets, replace these lines

For iCht = 1 To ActiveSheet.ChartObjects.Count
' copy chart as a picture
ActiveSheet.ChartObjects(iCht).Chart.CopyPicture _
Appearance:=xlScreen, Size:=xlScreen, Format:=xlPicture

with these lines

For iCht = 1 To ActiveWorkbook.Charts.Count
' copy chart as a picture
ActiveWorkbook.Charts(iCht).CopyPicture _
Appearance:=xlScreen, Size:=xlScreen, Format:=xlPicture

This will copy every chart sheet to its own slide.

If you have one chart embedded in each worksheet, you can try this
variation:

For iCht = 1 To ActiveWorkbook.Worksheets.Count
' copy chart as a picture
ActiveWorkbook.Worksheets(iCht).ChartObjects(1).Ch art.CopyPicture _
Appearance:=xlScreen, Size:=xlScreen, Format:=xlPicture


- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"My Own IT dept" wrote in message
...
Jon,

First let me say that I am a complete novice when it comes to using VBE.
I
feel as if I'm in another counrty, don't understand the language and am
using
hand gestures and grunting to try to get my problem solved. I'm missing
some
basic understanding of how this whole system works. That said...

I'm trying to copy multiple charts (1 per worksheet) from a range of
worksheets.
I highlight the range of WS tabs and run the macro (F5). I get no error
message but nothing happens (no charts copied). I have a PPT document
open
with more than enough blank pages (although I don't think that's necessary
based on what I think I read in the code).

Is there something else I should be doing?

Here is the code that I entered into the VBE editor (should look very
familiar):

Sub ChartstoPresentation()
' Set a VBE reference to Microsoft PowerPoint Object Library

Dim PPApp As PowerPoint.Application
Dim PPPres As PowerPoint.Presentation
Dim PPSlide As PowerPoint.Slide
Dim PresentationFileName As Variant
Dim SlideCount As Long
Dim iCht As Integer

' Reference existing instance of PowerPoint
Set PPApp = GetObject(, "Powerpoint.Application")
' Reference active presentation
Set PPPres = PPApp.ActivePresentation
PPApp.ActiveWindow.ViewType = ppViewSlide

For iCht = 1 To ActiveSheet.ChartObjects.Count
' copy chart as a picture
ActiveSheet.ChartObjects(iCht).Chart.CopyPicture _
Appearance:=xlScreen, Size:=xlScreen, Format:=xlPicture

' Add a new slide and paste in the chart
SlideCount = PPPres.Slides.Count
Set PPSlide = PPPres.Slides.Add(SlideCount + 1, ppLayoutBlank)
PPApp.ActiveWindow.View.GotoSlide PPSlide.SlideIndex
With PPSlide
' paste and select the chart picture
.Shapes.Paste.Select
' position the chart
With PPApp.ActiveWindow.Selection.ShapeRange
.Top = 94 ' points
.Left = 58 ' points
.Width = 8.2 * 72
.Height = 5.6 * 72
End With
End With

Next

' Clean up
Set PPSlide = Nothing
Set PPPres = Nothing
Set PPApp = Nothing

End Sub

-----

Any suggestions?

Thanks very much.


"Jon Peltier" wrote:

I don't recall now, and if I recalled then I'd probably have mentioned
it.

To get back to your original question, you could adjust the pasted
object's
size and position:

With PPSlide
' paste and select the chart picture
.Shapes.Paste.Select
' align the chart
With PPApp.ActiveWindow.Selection.ShapeRange.
.Top = [some value]
.Left = [some value]
.Height = [some value]
.Width = [some value]
End With


- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"My Own IT dept" wrote in message
...
Jon,

I've tried to find that other forum in which you said how to set the
desired
chart size right in Excel, but can't. Please let me know which one it
is.

Thanks.


"Jon Peltier" wrote:

In a different forum I answered one way, that you should make it in
Excel
so
that it comes out right in PowerPoint. I stick by that, but I'll
answer
the
other way as well. You can adjust this part of the code to handle
resizing
of the chart.

With PPSlide
' paste and select the chart picture
.Shapes.Paste.Select
' align the chart
PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignCenters,
True
PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignMiddles,
True
End With

Instead of centering the chart, position and resize it:

With PPSlide
' paste and select the chart picture
.Shapes.Paste.Select
' position the chart
With PPApp.ActiveWindow.Selection.ShapeRange
.Top = 72 ' points
.Left = 0
.Width = 9.66 * 72
.Height = 5.66 * 72
End With
End With

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"mustang25" wrote in message
...
Jon,

This is working brilliantly. I'd like to throw one more challenge
at
you
if
you don't mind. It follows below. Here is the code I'm using for
the
macro
(you'll notice that I removed the line/command that copies the chart
as
a
picture. This is intentional.):

Sub ChartsToPresentation()
' Set a VBE reference to Microsoft PowerPoint Object Library

Dim PPApp As PowerPoint.Application
Dim PPPres As PowerPoint.Presentation
Dim PPSlide As PowerPoint.Slide
Dim PresentationFileName As Variant
Dim SlideCount As Long
Dim iCht As Integer

' Reference existing instance of PowerPoint
Set PPApp = GetObject(, "Powerpoint.Application")
' Reference active presentation
Set PPPres = PPApp.ActivePresentation
PPApp.ActiveWindow.ViewType = ppViewSlide

For iCht = 1 To ActiveSheet.ChartObjects.Count
' copy chart as a picture
ActiveSheet.ChartObjects(iCht).Copy

' Add a new slide and paste in the chart
SlideCount = PPPres.Slides.Count
Set PPSlide = PPPres.Slides.Add(SlideCount + 1, ppLayoutBlank)
PPApp.ActiveWindow.View.GotoSlide PPSlide.SlideIndex
With PPSlide
' paste and select the chart picture
.Shapes.Paste.Select
' align the chart
PPApp.ActiveWindow.Selection.ShapeRange.Align
msoAlignCenters,
True
PPApp.ActiveWindow.Selection.ShapeRange.Align
msoAlignMiddles,
True
End With

Next

' Clean up
Set PPSlide = Nothing
Set PPPres = Nothing
Set PPApp = Nothing

End Sub

Is there a way to output the charts to PowerPoint with the following
parameters:

Height 5.66 inches
Width 9.66 inches
Horizontal Position 0 inches from top left corner
Vertical Position 1 inch from top left corner

Many thanks in advance!


"Jon Peltier" wrote:

I suspect you didn't set the reference to PowerPoint. It's
described
higher
on the page than the specific code you must have copied. Just under
the
big
title "Activating Other Applications with Excel VBA".

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______

"mustang25" wrote in message
...
It amazes me to see the amount of knowledge stored on these
forums.
I'm
seriously impressed that there is an answer to my question.
Thank
you
Jon.

Unfortunately, my VB skills are at about the same level as my 2

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple instances of Excel Carol Crowley Excel Discussion (Misc queries) 9 March 17th 06 07:18 PM
how to copy multiple Excel files from Outlook into Excel??? Brainless_in_Boston Excel Discussion (Misc queries) 0 February 24th 06 04:46 PM
Excel should heavily extend the options for black-white charts Dan from Sweden Charts and Charting in Excel 0 October 17th 05 01:26 PM
I cant get Excel OFFSET Fnct to return multiple references. dmkirk Charts and Charting in Excel 2 October 15th 05 01:58 PM
I need to merge text from an Excel doc. into a powerpoint slide? trainer07 Excel Discussion (Misc queries) 1 June 29th 05 07:11 PM


All times are GMT +1. The time now is 08:34 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"