我的宏如下所示。我正在尝试将我的 excel 工作表保存为 pdf 文档。当我运行宏时,我收到“打印时出错”消息,然后是:运行时错误“1004”:应用程序定义或对象定义错误
我正在运行 Microsoft Excel for Mac 版本 15.13.1。
这是我的宏。怎么了?
Sub SAVE_DIRECTORY_IN_PDF_FORMAT()
Dim DIRECTORY As Worksheet
Dim DIRECTORY2 As Worksheet
Sheets("DIRECTORY").Select
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, _
Filename:="DIRECTORY.pdf", _
Quality:=xlQualityStandard, IncludeDocProperties:=True, _
IgnorePrintAreas:=False, OpenAfterPublish:=False
Sheets("DIRECTORY2").Select
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, _
Filename:="DIRECTORY with Emails.pdf", _
Quality:=xlQualityStandard, IncludeDocProperties:=True, _
IgnorePrintAreas:=False, OpenAfterPublish:=False
End Sub