【发布时间】:2017-01-30 07:05:25
【问题描述】:
这是我正在使用的代码:
saveExcelasPDF("Users:Seth:Documents:OneDrive:Process:12648 0920 Volvo of the Triad 128.xlsx", "Users:Seth:Desktop:test.pdf")
on saveExcelasPDF(documentPath, PDFName)
set tFile to (POSIX path of documentPath) as POSIX file
tell application "/Applications/Microsoft Excel.app"
set isRun to running
set wkbk1 to open workbook workbook file name documentPath
activate object worksheet "Invoice" of wkbk1
set mySheet to sheet "Invoice" of wkbk1
alias PDFName -- Necessary to avoid Excel Sandboxing
save mySheet in PDFName as PDF file format
close wkbk1 saving no
if not isRun then quit
end tell
end saveExcelasPDF
现在,它将所需书籍中的每张纸保存到 PDF 文件中,所以我最终得到了一个大约 60 页的 PDF..
如何仅将“发票”表保存到我的 PDF 文件中?
谢谢!
【问题讨论】:
标签: excel macos pdf applescript