首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >从Sharepoint打开ppt on命令按钮单击- VBA

从Sharepoint打开ppt on命令按钮单击- VBA
EN

Stack Overflow用户
提问于 2019-02-22 23:53:06
回答 1查看 261关注 0票数 0

我想使用VBA打开ppt form SharePoint,使用命令按钮

如果有人知道,请帮帮我。

谢谢..。

我有类似的code...below..但它给了我错误

代码语言:javascript
复制
Dim PPT As PowerPoint.Application
Dim fileName As Variant
Dim WS1 As Worksheet
Dim rng As Range
Set WS1 = ThisWorkbook.Worksheets("Sheet4")
Set rng = WS1.Range("AA4")


Set PPT = New PowerPoint.Application
fileName = rng

PPT.Visible = True

'PPT.Presentations.Open fileName:="F:\Reports\" & Business_Plan.Value & ".ppt"
PPT.Presentations.Open fileName("AA4")
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-02-23 05:02:46

假设表1中的"A2“值是整个Path+File名称(F:\Reports\FileName.ppt)

代码语言:javascript
复制
Sub openPowerP()
    Dim PPT As PowerPoint.Application
    Dim fileName As String
    Dim WS1 As Worksheet
    Set WS1 = ThisWorkbook.Sheets("Sheet1")
    fileName = WS1.Range("A2").Value
    Set PPT = New PowerPoint.Application
    PPT.Presentations.Open fileName
End Sub

当然,对powerpoint的引用是必要的。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/54830743

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档