在Windows和Mac上将Excel文件保存为PDF [英] Saving an Excel File as PDF on both Windows and Mac

查看:272
本文介绍了在Windows和Mac上将Excel文件保存为PDF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经创建了一个宏来将我的工作表导出为PDF,但公司的一些用户使用Mac OS。当这些用户尝试保存时,会给他们一个错误。如何让Win和Mac用户使用相同的PDF导出?

I have created a macro to export my sheet as a PDF however some users in the company use Mac OS. When these users attempt to save, it gives them an error. How do I allow both Win and Mac users to use the same PDF export?

这是我现在的代码:

Sub CreatePDF()
    Dim wksSheet As Worksheet
        Set wksSheet = ActiveSheet
            wksSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
                ThisWorkbook.Path & "\" & Range("exportName"), Quality:=xlQualityStandard, _
                IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:= _
                False
End Sub


推荐答案

VBA也有Application.PathSeparator。

VBA has Application.PathSeparator as well.

http:// msdn .microsoft.com / en-us / library / office / ff820973%28v = office.15%29.aspx

这篇关于在Windows和Mac上将Excel文件保存为PDF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆