LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 137
Default Chart to PPT without opening PowerPoint

By modifying the code available in this group now i can have each chart
sheet in seperate slides.

Is there a way that I can have this without activating powerpoint? when
i do this without activating I get only once slide..

Thanks


Sub Chart2PPT()

Dim PPApp As PowerPoint.Application
Dim PPPres As PowerPoint.Presentation
Dim PPSlide As PowerPoint.Slide
Dim PPShape As PowerPoint.Shape
Dim Fname As Variant
Dim CurTitle As Variant
Dim SlideCount As Long
Dim iCht As Chart

Set PPApp = CreateObject("Powerpoint.Application")
Set PPPres = PPApp.Presentations.Add

Application.ScreenUpdating = False
CurTitle = "XlChartToPPT"

Fname = ThisWorkbook.Path & Application.PathSeparator & CurTitle &
".ppt"

For Each iCht In ActiveWorkbook.Charts

iCht.CopyPicture xlScreen, xlPicture, xlScreen
SlideCount = PPPres.Slides.Count

Set PPSlide = PPPres.Slides.Add(SlideCount + 1, ppLayoutBlank)
PPApp.Visible = True
AppActivate PPApp.Name

With PPSlide

.Shapes.Paste
Set PPShape = .Shapes(.Shapes.Count)
PPShape.Left = 0#
PPShape.Top = 0#
End With
SlideCount = SlideCount + 1
Next iCht
With PPPres
.SaveAs Fname
.Close
End With

PPApp.Quit

Set PPApp = Nothing
Set PPPres = Nothing

End Sub

 
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
excel chart to powerpoint k2sarah Excel Programming 1 February 22nd 06 10:25 PM
Opening Powerpoint file from Excel JakeyC Excel Programming 6 November 29th 05 10:54 AM
Help in opening powerpoint file variable from excel Mithi_M Excel Programming 1 August 1st 04 04:33 PM
Opening a new PowerPoint chart with excel vba KDUT Excel Programming 1 May 15th 04 04:39 AM
VBA to add a new chart into a PowerPoint presentation KJD Excel Programming 0 April 28th 04 03:12 PM


All times are GMT +1. The time now is 10:32 PM.

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

About Us

"It's about Microsoft Excel"