6,210
社区成员
发帖
与我相关
我的任务
分享
Dim s1
s1 = Range("F1") & ":" & Range("H1")
Dim tosi As String
Dim pathT As String
pathT = ThisWorkbook.Path & "\" & Replace(ActiveWorkbook.Name, ".xls", ".ppt")
tosi = InputBox("plz input the Power Point file path and name", Title:="Power Point file", Default:=pathT)
'PowerPoint save
ppApp.ActivePresentation.SaveAs Filename:=tosi
'Excel sheets copy
For i = 1 To ThisWorkbook.Worksheets.Count
ThisWorkbook.Worksheets(i).Range(s1).CopyPicture xlScreen, xlPicture
'copy to PowerPoint
Set ppSld = ppPst.Slides.Add(Index:=i, Layout:=12)
'paste
ppSld.Shapes.Paste
'Correction to maximize the PowerPoint chart position and size
With ppSld.Shapes(1)
.LockAspectRatio = msoFalse
.Top = 0
.Left = 0
.Height = ppH
.Width = ppW
End With
Next i
tosi = InputBox("plz input the Power Point file path and name", Title:="Power Point file", Default:=pathT)
改成
tosi = Application.InputBox("plz input the Power Point file path and name", Title:="Power Point file", Default:=pathT)