ExportAsFixedFormat PDF已停止Office 365

时间:2018-11-29 00:06:08

标签: excel vba excel-vba pdf export

我是基本用户。我通常将Google搜索和stackoverflow建议中的VBA代码拼凑在一起。我有一本使用"ExportAsFixedFormat Type:=xlTypePDF"的工作簿。我有4行代码将工作表的各个页面保存到本地硬盘上的PDF中。自从有了一台新计算机(也许是从我升级到Office 365之后)以来,我的宏就一直返回此错误:

  

运行时错误'-2147417848(80010108)':

     

自动化错误

     

所调用的对象已与其客户端断开连接。

这是我现在拥有的代码...

Sub Savepdf()

Worksheets("Weekly").ExportAsFixedFormat Type:=xlTypePDF, Filename:="C:\Users\directoryhere\pc2018summer.pdf", Quality:=xlQualityMinimum, IncludeDocProperties:=True, IgnorePrintAreas:=False, From:=1, To:=10
Worksheets("Weekly").ExportAsFixedFormat Type:=xlTypePDF, Filename:="C:\Users\directoryhere\pc2018fall.pdf", Quality:=xlQualityMinimum, IncludeDocProperties:=True, IgnorePrintAreas:=False, From:=11, To:=25
Worksheets("Weekly").ExportAsFixedFormat Type:=xlTypePDF, Filename:="C:\Users\directoryhere\pc2018winter.pdf", Quality:=xlQualityMinimum, IncludeDocProperties:=True, IgnorePrintAreas:=False, From:=28, To:=42
Worksheets("Weekly").ExportAsFixedFormat Type:=xlTypePDF, Filename:="C:\Users\directoryhere\pc2018.pdf", Quality:=xlQualityMinimum, IncludeDocProperties:=True, IgnorePrintAreas:=False

End Sub

0 个答案:

没有答案