Oprette dias i PowerPoint skabelon inde fra Excel
Flg. kode opretter dias i PowerPoint inde fre Excel. Dias oprettes fra nyt PP-doc, men jeg vil gerne, at det oprettes fra PP-skabelon(min fil).Hvad skriver jeg i koden?Sub Dias()
'
' Range
'
Application.Goto Reference:="Område i Excel"
'
' KopierTilBillede
'
Selection.CopyPicture _
Appearance:=xlScreen, Format:=xlPicture
Application.Goto Reference:="Område i Excel - lavet om til billede"
ActiveSheet.Paste
'
' Billedstørrelse
'
Selection.ShapeRange.LockAspectRatio = msoTrue
Selection.ShapeRange.Height = 363.75
Selection.ShapeRange.Width = 682.5
Selection.ShapeRange.Rotation = 0#
Selection.Copy
'
' OpretDias
'
Dim PPApp As PowerPoint.Application
Dim PPTPres As PowerPoint.Presentation
Dim PPTSlide As PowerPoint.Slide
Set PPApp = CreateObject("Powerpoint.Application")
Set PPTPres = PPApp.Presentations.Add
PPApp.Visible = True
PPApp.ActiveWindow.ViewType = ppViewSlide
With PPTPres.Slides
Set PPTSlide = .Add(.Count + 1, ppLayoutText)
End With
Set PPTSlide = PPTPres.Slides(PPApp.ActiveWindow.Selection.SlideRange.SlideIndex)
Selection.CopyPicture Appearance:=xlScreen, _
Format:=xlPicture
PPApp.ActiveWindow.Selection.SlideRange.Shapes("Rectangle 3").Select
PPApp.ActiveWindow.View.Paste
Set PPTSlide = Nothing
Set PPTPres = Nothing
Set PPApp = Nothing
Selection.Delete 'Område i Excel - lavet om til billede, fjernes'
End Sub
