Hi,
I've seen some code examples doing this, does anybody have it or know it?
Question: I have no control what office version except that it is not -97
but 2000 or later. Are there any things I need to know/think of regarding
that?
Kind Regards
Hi,
I've seen some code examples doing this, does anybody have it or know it?
Question: I have no control what office version except that it is not -97
but 2000 or later. Are there any things I need to know/think of regarding
that?
Kind Regards
Gunnar,
Jon Peltier has some very detailed instructions on his site that might help:
http://peltiertech.com/Excel/XL_PPT.html
--
Regards,
John Mansfield
http://www.pdbook.com
"Gunnar Johansson" wrote:
> Hi,
>
> I've seen some code examples doing this, does anybody have it or know it?
>
> Question: I have no control what office version except that it is not -97
> but 2000 or later. Are there any things I need to know/think of regarding
> that?
>
> Kind Regards
>
>
>
Hi
I use this code to copy charts on chartsheets as pictures into powerpoint, then save the file in a temporary directory. Pictures are quickest, and I find they use the least memory in the powerpoint presentation (this exports 270 charts in less than 2 minutes, and the final powerpoint file is just over 1MB)
you will need to adjust the chart's dimensions on pasting depending on their original size.
Sub powerpoint_export_charts()
'copies pictures of all charts in the workbook into a new pp presentation
'ensure microsoft powerpoint object library is checked in tools references
Dim PwrPtApp As PowerPoint.Application
Dim PwrPtPres As PowerPoint.Presentation
Dim PwrPtSlide As PowerPoint.Slide
Set PwrPtApp = CreateObject("Powerpoint.Application")
PwrPtApp.Visible = True
Set PwrPtPres = PwrPtApp.Presentations.add
For n = 1 To ActiveWorkbook.Charts.Count
ActiveWorkbook.Charts(n).CopyPicture
PwrPtPres.Slides.add n, ppLayoutBlank
PwrPtPres.Slides(n).Shapes.Paste
PwrPtPres.Slides(n).Shapes(1).Width = 700
PwrPtPres.Slides(n).Shapes(1).Left = 8
PwrPtPres.Slides(n).Shapes(1).Top = 12
Next
PwrPtApp.WindowState = ppWindowMinimized
res = "c:\temp\charts " & Format(Date, "dd mmm yy" & ".ppt")
res = InputBox("enter file save path and name", "file save", res)
If res <> "" Then
With PwrPtPres
.SaveAs res
.Close
End With
PwrPtApp.Quit
Set PwrPtSlide = Nothing
Set PwrPtPres = Nothing
Set PwrPtApp = Nothing
End If
End Sub
Nicky
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks