Sub ChartToPresentation()
Sheets(i).ChartObjects("Chart 1").Copy
Dim PPApp As PowerPoint.Application
Dim PPPres As PowerPoint.Presentation
Dim PPSlide As PowerPoint.Slide
Set PPApp = GetObject(, "Powerpoint.Application")
Set PPPres = PPApp.ActivePresentation ' Reference active presentation
PPApp.ActiveWindow.ViewType = ppViewSlide
' PPPres.Slides(i + 4).Select
With PPPres.Slides(i + 4).Shapes.Paste
If i = 6 Then
.top = 60
ElseIf i = 7 Or i = 9 Then
.top = 120
Else
.top = 80
End If
.Left = 46
End With
HERE I NEED A LINE OR TWO THAT WILL BREAK THE LINK
End Sub
Thanks!Sub ChartToPresentation()
Set cht = Sheets(i).ChartObjects("Chart 1").Chart
cht.CopyPicture
Dim PPApp As PowerPoint.Application
Dim PPPres As PowerPoint.Presentation
Dim PPSlide As PowerPoint.Slide
Set PPApp = GetObject(, "Powerpoint.Application")
Set PPPres = PPApp.ActivePresentation ' Reference active presentation
PPApp.ActiveWindow.ViewType = ppViewSlide
' PPPres.Slides(i + 4).Select
With PPPres.Slides(i + 4).Shapes.PasteSpecial(DataType:=ppPasteDefault, Link:=msoFalse)
If i = 6 Then
.Top = 60
ElseIf i = 7 Or i = 9 Then
.Top = 120
Else
.Top = 80
End If
.Left = 46
End With
End Sub
ASKER
Sub ChartToPresentation()
Set cht = Sheets(1).ChartObjects("Chart 1").Chart
cht.CopyPicture
Dim PPApp As PowerPoint.Application
Dim PPPres As PowerPoint.Presentation
Dim PPSlide As PowerPoint.Slide
Set PPApp = GetObject(, "Powerpoint.Application")
Set PPPres = PPApp.ActivePresentation ' Reference active presentation
PPApp.ActiveWindow.ViewType = ppViewSlide
' PPPres.Slides(i + 4).Select
With PPPres.Slides(1).Shapes.PasteSpecial(DataType:=ppPasteMetafilePicture, Link:=msoFalse)
If i = 6 Then
.Top = 60
ElseIf i = 7 Or i = 9 Then
.Top = 120
Else
.Top = 80
End If
.Left = 46
End With
End Sub
ASKER
Microsoft Excel topics include formulas, formatting, VBA macros and user-defined functions, and everything else related to the spreadsheet user interface, including error messages.
TRUSTED BY
ASKER
How do I fix that? Is there any way we can put the code at the end of the master macro ("PasteAllCstmrCharts"? It's not essential to select PPPres.Slides(7), if that helps.
Thanks,
John
Open in new window