vba - 使用 excel VBA 将 Powerpoint 保存为 PDF
问题描述
当我尝试运行下面的代码时,我收到“运行时错误 '13' 类型不匹配”错误消息。它在我尝试导出为固定格式的第 6 行代码中提供错误。
Sub Button5_Click()
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs FileName:="P:\SFO-CSIM-Dept\Risk-Mgmt\SubAdvised\20" & Range("F14").Value & "\InvRisk_" & Range("F15").Value & "_USE4L_Risk Report_" & Range("F14").Value & ".xlsm"
Set PowerPointApp = GetObject(class:="PowerPoint.Application")
PowerPointApp.ActivePresentation.SaveAs FileName:="P:\SFO-CSIM-Dept\Risk-Mgmt\SubAdvised\20" & Range("F14").Value & "\InvRisk_" & Range("F15").Value & "_USE4L_Risk Report_" & Range("F14").Value & ".pptx"
PowerPointApp.ActivePresentation.ExportAsFixedFormat PowerPointApp.ActivePresentation.Path & "\" & PowerPointApp.ActivePresentation.Name & ".pdf", ppFixedFormatTypePDF, ppFixedFormatIntentPrint
Application.DisplayAlerts = True
End Sub
我在这里先向您的帮助表示感谢!
解决方案
推荐阅读
- linux - 为什么 gcc 默认与“-z now”链接,虽然惰性绑定是 ld 的默认值?
- java - How to check if a directory exist based on the path java
- java - 当if条件为真或假时如何使用Jbutton显示不同的评论
- go - Will time.Sleep block goroutine?
- google-oauth - Google ID 令牌中没有 email 或 email_verified 声明
- r - 如何计算真阳性率?
- jestjs - 无法解析 ApplicationModule 的所有参数:(?)使用 Jest
- java - 如何仅获取整数对象,仅字符串对象,甚至仅整数对象......?
- python - 多个字符串列上的熊猫聚合
- python - 用拉格朗日插值求多项式的常数项