对象“_worksheet”的方法“ExportAsFixedFormat”失败

这里是我的代码导出所有的Excel表格到PDF:

Sub printing() Dim i As Integer, wkb As String, head As String, nm As String Dim ws As Worksheet Application.ScreenUpdating = False 'get folder path wkb = InputBox("Enter folder path:", , ActiveWorkbook.Path) If Right(wkb, 1) <> Application.PathSeparator Then wkb = wkb & Application.PathSeparator 'head of file name head = InputBox("Enter head of file name", , "Test") Application.DisplayAlerts = False For Each ws In ActiveWorkbook.Worksheets 'ActiveWorkbook.Sheets.Count If ws.Visible = True Then ws.Select nm = ws.Range("A1") If nm <> "" Then 'save ActiveSheet.ExportAsFixedFormat _ Type:=xlTypePDF, _ FileName:=wkb & head & nm & ".pdf", _ Quality:=xlQualityStandard, _ IncludeDocProperties:=True, _ IgnorePrintAreas:=False, _ OpenAfterPublish:=False End If Application.DisplayAlerts = False End If Next Application.DisplayAlerts = True Application.ScreenUpdating = True MsgBox "Done" End Sub 

我在我的Mac和我的朋友的Mac上运行这个macros,但我的Mac是通过,我的朋友的Mac不通过,发生了一个错误:

运行时错误“1004”:

对象“_worksheet”的方法“ExportAsFixedFormat”失败

你能告诉我一个解决scheme吗?

谢谢。