Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have passed along this code to someone using office 2007 and it does not
work. It works fine in Office 2003 but wondering if something is amiss with 2007. It is getting stuck at Dim PPApp As PowerPoint.Application and says "Compile error, user-defined type not defined". Please help. Sub ChartToPresentation() ' Set a VBE reference to Microsoft PowerPoint Object Library Dim PPApp As PowerPoint.Application Dim PPPres As PowerPoint.Presentation Dim PPSlide As PowerPoint.Slide ' Make sure a chart is selected If ActiveChart Is Nothing Then MsgBox "Please select a chart and try again.", vbExclamation, _ "No Chart Selected" Else ' Reference existing instance of PowerPoint Set PPApp = GetObject(, "Powerpoint.Application") ' Reference active presentation Set PPPres = PPApp.ActivePresentation PPApp.ActiveWindow.ViewType = ppViewSlide ' Reference active slide Set PPSlide = PPPres.Slides _ (PPApp.ActiveWindow.Selection.SlideRange.SlideInde x) ' Copy chart as a picture ActiveChart.CopyPicture Appearance:=xlScreen, Size:=xlScreen, _ Format:=xlBitmap ' Paste chart PPSlide.Shapes.Paste.Select ' Align pasted chart PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignCenters, True PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignMiddles, True ' Clean up Set PPSlide = Nothing Set PPPres = Nothing Set PPApp = Nothing End If End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Cannot copy Excel 2007 Chart and Paste as Bitmap into Powerpoint 2 | Charts and Charting in Excel | |||
Copy/Paste custom Excel chart to Word/PowerPoint | Excel Discussion (Misc queries) | |||
Can I paste a chart from Excel into a powerpoint slide "Placeholde | Charts and Charting in Excel | |||
Distorted Excel chart fonts when copy/paste to Word or Powerpoint | Charts and Charting in Excel | |||
VBA: open PowerPoint and paste a chart | Excel Programming |