excel - ExportAsFixedFormat PDF 停止了 Office 365
问题描述
我是一个基础用户。我通常将我的 VBA 代码从谷歌搜索和 stackoverflow 建议拼凑在一起。我有一本使用"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
解决方案
推荐阅读
- assembly - 二分之十字节而不是 20 字节怎么算?
- sql-server - 有人可以帮我理解为什么下面的查询会出现不同的结果
- java - 无法使用 sphinx4 识别实时流语音
- rx-java2 - 使用 RxJava2 中的一系列运算符一次处理一个 PublishSubject 发射
- visual-studio - 你能改变Visual Studio中评论的颜色吗?
- csv - Lua - 如何更改 .csv 文件的第一行?
- ag - FZF - 搜索目标文件夹
- sql-server - Visual Studio SSDT 数据库项目在重新启动时不会显示架构节点
- javascript - 在角度的标题excel js之前添加行
- python - 序列化 JSON 数据的问题