0
我使用下面的代码:如何使用AppleScript的一个单一的Excel工作表保存为PDF
set PDFName to --desired path and name of PDF file to save
set excelName to --desired path and name of Excel file to open
tell application "/Applications/Microsoft Excel.app"
set isRun to running
set wkbk1 to open workbook workbook file name excelName
--Problem
save (sheet "Invoice" of wkbk1) in PDFName as PDF file format
--/Problem
close wkbk1 saving no
if not isRun then quit
end tell
我最终转换成60页长的PDF的整个工作簿,而不是只有一张单!难道我做错了什么?我怎样才能解决这个问题?
我认为你的答案是#2链接:[链接](http://stackoverflow.com/questions/37394771/applescript-excel-2016-save-as -pdf) – pbell
我实际上使用这个帖子来写这个编码。我遇到的问题与他认为的不同...... –
我自己测试了它,尽管“保存活动工作表”,它仍然保存了Excel 2011中的所有工作表。它似乎是Excel的错误!然后,我建议在保存之前删除您不想转换的所有工作表...然后只转换所需工作表。 ...并关闭工作簿而不保存。 – pbell