【问题标题】:saving a xlsheet to pdf = document not saved将 xlsheet 保存为 pdf = 文档未保存
【发布时间】:2018-09-07 17:03:29
【问题描述】:

显然,我正在尝试将工作表另存为 pdf 文件,它只是给我一条错误消息,提示文档未保存。当我调试时一切都很好,但是当我调试时我检查 Type 它说 TypePDF=0

请帮忙。谢谢你 请注意目标工作表处于活动状态。

谢谢

Dim path As String
Dim fn1 As String
Dim fn2 As Date
Dim fn3 As String

path = "C:\Users\Christine Cordero\Desktop\Evercrete Philippines Transactions\Clients\Transaction Invoices"
fn1 = Range("CustomerNameLine").Value
fn2 = Range("InvoiceNumberDate").Value
fn3 = Range("InvoiceNumberLine").Value

Application.DisplayAlerts = False

'this is one code I was trying to save only a range of that sheet.   

' Save Invoice as PDF Option 1
Range("Print_Area").SaveAs filename:=path & fn1 & " " & fn2 & " " & fn3 & " " & ".xlsx", FileFormat:=xlOpenDocumentSpreadsheet

结束子

'上面的代码对我不起作用

【问题讨论】:

    标签: excel pdf


    【解决方案1】:

    我知道这只是一个简单的问题,最后,我能够弄清楚。

    问题是当我手动将文件另存为 pdf 时,提示设置标记选项,所以我猜这就是停止代码运行的原因,所以我改为设置 IncludeDocProperties=False 并且它工作。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-05-16
      • 1970-01-01
      • 1970-01-01
      • 2012-07-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多