我无法使用VBA将Excel工作表导出到Mac上的桌面

时间:2019-06-06 22:30:41

标签: excel vba permissions save

我无法将excel工作簿工作表导出到桌面。我只能将工作表导出到/Users/elijah/Library/Containers/com.microsoft.Excel/Data/Document。

不确定这是否有帮助,但这是我的代码:

Sub ExportAsPDFTest()

Dim Name As String
Dim Preface As String

Name = Cells(1, "B").Value
Preface = "PreR Summer 2019 - "

ActiveSheet.ExportAsFixedFormat _
    Type:=xlTypePDF, _
    FileName:=ActiveWorkbook.Path & Application.PathSeparator & Preface & Name & ".pdf", _
    Quality:=xlQualityStandard, _
    IncludeDocProperties:=False, _
    IgnorePrintAreas:=False, _
    From:=1, _
    To:=1, _
    OpenAfterPublish:=False


End Sub

0 个答案:

没有答案