S
simon
Hi there,
I'm pasting a chart from Excel(2002) into my PPt (2002) presentation
with the following macro:
Sub FinaliseIt()
On Error GoTo Checkfiles_Err
Dim XLApp As Excel.Application
' Reference existing instance of Excel
Set XLApp = GetObject(, "Excel.Application")
XLApp.ActiveWorkbook.Activate
'Run XL macro
XLApp.Sheets("Sheet1").Select
XLApp.ActiveSheet.ChartObjects("Chart 5").Activate
XLApp.ActiveChart.ChartArea.Select
' Copy chart as a picture
XLApp.ActiveChart.CopyPicture Appearance:=xlScreen,
Size:=xlScreen, _
Format:=xlPicture
'Reference active PPT presentation
PowerPoint.Application.Visible = True
PowerPoint.Application.Activate
'PowerPoint.ActivePresentation.SlideShowWindow.View.GotoSlide 23
PowerPoint.ActiveWindow.View.GotoSlide Index:=23
PowerPoint.Application.Activate
PowerPoint.Application.Visible = msoCTrue
'Paste the chart into the presentation
PowerPoint.Application.ActiveWindow.View.Paste
..........'do more stuff here
End sub
This runs well but, and here's my problem, the slideshow view changes
to normal view.
Can I prevent this change from happening somehow?
Apologies if this is obvious
thank you in anticipation
Simon
I'm pasting a chart from Excel(2002) into my PPt (2002) presentation
with the following macro:
Sub FinaliseIt()
On Error GoTo Checkfiles_Err
Dim XLApp As Excel.Application
' Reference existing instance of Excel
Set XLApp = GetObject(, "Excel.Application")
XLApp.ActiveWorkbook.Activate
'Run XL macro
XLApp.Sheets("Sheet1").Select
XLApp.ActiveSheet.ChartObjects("Chart 5").Activate
XLApp.ActiveChart.ChartArea.Select
' Copy chart as a picture
XLApp.ActiveChart.CopyPicture Appearance:=xlScreen,
Size:=xlScreen, _
Format:=xlPicture
'Reference active PPT presentation
PowerPoint.Application.Visible = True
PowerPoint.Application.Activate
'PowerPoint.ActivePresentation.SlideShowWindow.View.GotoSlide 23
PowerPoint.ActiveWindow.View.GotoSlide Index:=23
PowerPoint.Application.Activate
PowerPoint.Application.Visible = msoCTrue
'Paste the chart into the presentation
PowerPoint.Application.ActiveWindow.View.Paste
..........'do more stuff here
End sub
This runs well but, and here's my problem, the slideshow view changes
to normal view.
Can I prevent this change from happening somehow?
Apologies if this is obvious
thank you in anticipation
Simon