LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How do I tell excel to export graphs to ppt and only have to update excel?

Hi Lisa,

I was working on this just the other day with some success.
The following code worked for me. You need to ensure that the
appropriate
references are ticked off in the visual basic editor. Tools -
references
The following worked fine in XP. Run the code from the active
worksheet with your graphs in it. I have not investigated pasting
these as links
prehaps someone else will modify the code to offer that level of
functionality.


Option Explicit

Sub GraphsToPowerpoint()

Dim PPApp As Powerpoint.Application
Dim PPPres As Powerpoint.Presentation
Dim PPSlide As Powerpoint.Slide
Dim SlideCount As Long
Dim x As Integer

Set PPApp = CreateObject("Powerpoint.Application.8")
Set PPPres = PPApp.Presentations.Add
Set PPSlide = PPPres.Slides.Add(Index:=1, Layout:=ppLayoutText)

For x = 1 To ActiveSheet.ChartObjects.count
ActiveSheet.ChartObjects(x).Chart.CopyPicture _
Appearance:=xlScreen, Size:=xlScreen, Format:=xlPicture

SlideCount = PPPres.Slides.count
Set PPSlide = PPPres.Slides.Add(SlideCount + 1, ppLayoutBlank)
PPApp.ActiveWindow.View.GotoSlide PPSlide.SlideIndex
With PPSlide
.Shapes.Paste.Select
PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignCenters,
True
PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignMiddles,
True
End With

Next

With PPPres
.SaveAs "C:\Temp\Name_of_presentation.ppt"
.Close
End With

PPApp.Quit

Set PPSlide = Nothing
Set PPPres = Nothing
Set PPApp = Nothing

HTH

Chris.

End Sub
"Lisa" wrote in message ...
Hello:

Can anyone hel me? I would like to take the graphs I've
created in excel and export them to a powerpoint
presentation. A graph per specific ppt slide. I would
like the graphs to be automatically updated in the ppt
presentation whenever I update the excel document.

Thank you very much.

 
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
Export Excel tuncating leading zeros while export to excel from da RHBKV Setting up and Configuration of Excel 1 July 15th 09 01:48 PM
Automatically update graphs ChrisG Charts and Charting in Excel 25 February 12th 07 05:29 PM
embedded presentation graphs in excel don't update, tables do sid Excel Worksheet Functions 0 October 4th 06 02:20 PM
excel graphs won't update ejfu Charts and Charting in Excel 0 July 6th 06 11:18 PM
export access to excel. change access & update excel at same time fastcar Excel Discussion (Misc queries) 0 June 24th 05 09:27 PM


All times are GMT +1. The time now is 03:20 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"