在Sharepoint上传活动PPT

时间:2017-11-10 14:24:12

标签: excel vb.net vba excel-vba

我正在尝试上传有关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

1 个答案:

答案 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