我正在尝试上传有关sharepoint的活动演示文稿并面临代码问题。下面是脚本。请帮忙解决:
Sub Saveuploadppt()
'Dim newPowerPoint As PowerPoint.Application
Dim filenm As Variant
Dim month As String
Dim d As String
Dim powerpoint As Object
month = Format(Date - 1, "mmm'yy")
d = Format(Date - 1, "mm-dd-yyyy")
filenm = "Control Dashboard " & month & "MTD_" & d & ".pptx"
MsgBox filenm
powerpoint.Application.ActivePresentation.SaveAs "File path "", 1
End Sub
答案 0 :(得分:1)
以下是解决方案:)
Sub Saveuploadppt()
'Dim newPowerPoint As PowerPoint.Application
Dim filenm As Variant
Dim month As String
Dim d As String
Dim powerpoint As Object
month = Format(Date - 1, "mmm'yy")
d = Format(Date - 1, "mm-dd-yyyy")
filenm = "Control Dashboard " & month & "MTD_" & d & ".pptx"
MsgBox filenm
Dim ppApp As powerpoint.Application
Set ppApp = GetObject(, "PowerPoint.Application")
PpApp.ActivePresentation.SaveAs "path" & filenm & "", 1
End Sub