下面的 VBA 代码在 Windows 上打开打印对话框,但在 Mac Excel 2011 上不起作用,在行上给出运行时错误 1004Application.Dialogs(xlDialogPrinterSetup).Show
Private Sub cbPrint_Click()
Dim Caption As String
If formPrintOptions.Frame1.ActiveControl.Value Then
Caption = formPrintOptions.Frame1.ActiveControl.Caption
formPrintOptions.Hide
Application.Dialogs(xlDialogPrinterSetup).Show
Select Case Caption
Case "Id1"
ThisWorkbook.Sheets(Array("FrontPage", "Id1")).PrintOut Preview:=True
Case "Id2"
ThisWorkbook.Sheets(Array("FrontPage", "Id2")).PrintOut Preview:=True
Case "Id3"
ThisWorkbook.Sheets(Array("FrontPage", "Id3")).PrintOut Preview:=True
Case "Id4"
ThisWorkbook.Sheets(Array("FrontPage", "Id4")).PrintOut Preview:=True
Case Else
End Select
Else
MsgBox "None selected"
End If
Unload formPrintOptions
End Sub
请有人建议是否有办法在 Mac Excel 2011 上打开打印对话框窗口?