So I thought I'd fixed it with Late Binding, but haven't. Or maybe I just did it wrong.
The problem is a regular failure due to a missing Powerpoint Library (12.0) when an Excel 2007 user updates the spreadsheet and then an Excel 2003 user tries the Powerpoint macro.
Can I stop the spreadsheet creating a link to a 12.0 library file or is this down to Excel version compatibility?
Please help if you can - much appreciated.
Sub Save_to_Powerpoint()
Dim PPApp As Object
Dim PPPres As Object
Dim PPSlide As Object
Dim oPP As Object
'New presentation
Set oPP = CreateObject("powerpoint.application")
'Reference active presentation
Set PPApp = GetObject(, "Powerpoint.Application")
'Copy Stat_Rept data as picture
Range(ActiveSheet.name & "!Print_Area").Select
Selection.CopyPicture Appearance:=xlScreen, Format:=xlPicture
'add new presentation,make A4 blank & Paste the range
PPApp.Presentations.Add
PPApp.Visible = msoCTrue
PPApp.ActivePresentation.Slides.Add PPApp.ActivePresentation.Slides.Count + 1, ppLayoutBlank
PPApp.ActivePresentation.PageSetup.SlideSize = ppSlideSizeA4Paper
oPP.ActiveWindow.View.PasteSpecial DataType:=ppPasteEnhancedMetafile
' Align the pasted range
With PPApp.ActiveWindow.Selection.ShapeRange
.Height = 750
.Width = 780
.Align msoAlignleft, True
.Align msoAlignMiddles, True
.Fill.ForeColor.SchemeColor = ppBackground
.Fill.Visible = msoTrue
.Fill.Solid
.Fill.Transparency = 0#
End With
'Clean Up
Set PPSlide = Nothing
Set PPPres = Nothing
Set PPApp = Nothing
End Sub
Bookmarks