• Print Dialog arg: ? (Excel 2002/2003)

    Author
    Topic
    #436174

    Hi

    Sub PrintDialogShow()
    Application.Dialogs(xlDialogPrint).Show arg12:=2 (This arg sets Print What to Active Sheets) I also would like to set the arg for Print Range Page(s) as apposed to All but I can’t work it out)

    End Sub

    Many Thanks

    Braddy

    Viewing 0 reply threads
    Author
    Replies
    • #1033186

      If you look up the help subject for Arguments for built-in dialogs in the VBA help, and scroll down to xlDialogPrint, you’ll see that the first argument is ‘range_num’, the second one is ‘from’, and the third one is ‘to’. Since you want the second option in the Print Range box, you must use 2 for the range_num argument. So to print pages 5 to 9:

      Application.Dialogs(xlDialogPrint).Show Arg1:=2, Arg2:=5, Arg3:=9, Arg12:=2

      You can find the names of the other arguments in the help subject I mentioned; you’ll have to make a reasoned guess at their exact meaning.

      • #1033195

        Hi Hans

        Thanks very much for your prompt reply and explanation.

        Braddy

        • #1033206

          Braddy,
          If you have the Macrofun.hlp file (you can download it from MS), you can look up the PRINT function – the arguments are the same as the dialog’s I believe and the explanation of what they are is very good.
          HTH

          • #1033232

            Hi Rory

            Thanks for that, had a quick look, it does exactly what you describe,

            Braddy

    Viewing 0 reply threads
    Reply To: Print Dialog arg: ? (Excel 2002/2003)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: