通过 VBA 将 MS Excel 2003 工作簿导出为 PDF
我有一个 Excel 2003 工作簿,其中包含一个宏,用于将其某些工作表复制到新工作簿,然后保存并关闭新工作簿。 它会执行此操作数十次,每次选择的纸张都略有不同。
我想向宏添加一个额外的步骤,以将辅助工作簿的电子表格导出为 PDF。 最明显的方法是使用 PDF 打印机和 Excel 的内置打印功能,但大多数 PDF 打印机在完成之前都会显示“另存为...”对话框。 显然,在七十多个场合单独输入这个内容缺乏吸引力 - 所以我想要一些可以让我提前设置它的东西(可能是“使用我正在打印的文件的文件名减去其扩展名”),然后只需选择默认选项。
有什么想法可以制作一款免费的 PDF 打印机吗? 或者合适的替代方案?
I have an Excel 2003 workbook that contains a macro to copy certain of its sheets across to a new workbook, then save and close the new workbook. It does this several dozen times, with slightly different sheet selections each time.
I would like to add an extra step to the macro to export the secondary workbooks' spreadsheets to PDF. The obvious way to do this would be to use a PDF printer and Excel's built in Print function, but most PDF printers give you a "Save As..." dialogue box before they finish. Obviously, typing this in individually for seventy-odd occasions lacks appeal - so I'd like something that allows me to set it ahead of time (probably "Use the filename of the file I'm printing minus its extension") then just select the default options.
Any ideas for a free PDF printer that does this? Or a suitable alternative?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Office 2007 允许这样做。 我发现 PDFCreator 很好,VBA 包含在示例文件中,并且听说CutePDF 也不错。 PDFCreator 和 CutePDF 是免费的。
Office 2007 allows for this. I have found PDFCreator to be good, the VBA is included in sample files, and have heard that CutePDF is also good. PDFCreator and CutePDF are free.
作为 Remou 的(明智的)答案的发展,因为这也帮助我解决了我的问题。
我选择 pdfcreator (因为我已经安装了它),这就是我最终使用的:
Works像一个魅力
As a development on the (wise) answer from Remou, and since this was what helped me out on my problem too.
I choose pdfcreator (since I already had it installed) and this is what I ended up using:
Works like a charm
这可能会有所帮助: http://www.pdf995.com
一项功能是“绕过三个自动命名选项”另存为对话框”
This may help: http://www.pdf995.com
One feature is "Three auto-name options to bypass Save As dialog"