0

以下のVBAコードは、Windowsで印刷ダイアログを開きますが、Mac Excel 2011では機能せず、行にランタイムエラー1004が表示されます。Application.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で印刷ダイアログウィンドウを開く方法があるかどうか誰かにアドバイスしてもらえますか?

4

1 に答える 1

1

ここから、次の 3 つのオプションがあります。

(引用)

その場合、その機能は Mac の通常の印刷画面の「一番上」にあります。下位のダイアログを呼び出す必要がないという意味と、[印刷ダイアログ] ボックスの他のすべてのオプションよりも上にあるという意味の両方で、「上に」。

また

Application.Dialogs(xlDialogPrint).Show

また

MsgBox MacScript(PrintSetupMacScript())

Function PrintSetupMacScript() As String
PrintSetupMacScript = "try"
PrintSetupMacScript = PrintSetupMacScript & vbLf & "tell application ""System Preferences"" "
PrintSetupMacScript = PrintSetupMacScript & vbLf & "    reveal pane ""Print & Fax"" "
PrintSetupMacScript = PrintSetupMacScript & vbLf & "    activate"
PrintSetupMacScript = PrintSetupMacScript & vbLf & "    repeat while (name of window 1) = ""Print & Fax"" "
PrintSetupMacScript = PrintSetupMacScript & vbLf & "   end repeat"
PrintSetupMacScript = PrintSetupMacScript & vbLf & "end tell"
PrintSetupMacScript = PrintSetupMacScript & vbLf & "return true"
PrintSetupMacScript = PrintSetupMacScript & vbLf & "on error"
PrintSetupMacScript = PrintSetupMacScript & vbLf & "return false"
PrintSetupMacScript = PrintSetupMacScript & vbLf & "end try"
End Function

これらをテストするためのMacを持っていないので、走行距離を保証できません

于 2013-01-14T21:28:58.657 に答える