Results 1 to 5 of 5

Thread: Print Button

  1. #1
    5 Star Lounger
    Join Date
    Aug 2001
    Location
    Surrey, United Kingdom
    Posts
    1,001
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Afternoon all

    I want to put a Print button on a form that opens up the print dialog box, I beleive that this is the correct wording

    Application.Dialogs(xlDialogPrint).Show

    I know this probably sounds really dense but how do I assign it to the button?

    I have added the button, right clicked it to add a macro but nothing comes up, I have tried an onclick event but it still does not do it.
    Cheers

    Steve

    Asking the questions everbody wants the answers too but feels too stupid to ask themselves :-)

  2. #2
    3 Star Lounger
    Join Date
    Nov 2002
    Location
    New York, New York, USA
    Posts
    266
    Thanks
    0
    Thanked 19 Times in 19 Posts
    [quote name='stevehocking' post='767263' date='25-Mar-2009 10:40']Afternoon all

    I want to put a Print button on a form that opens up the print dialog box, I beleive that this is the correct wording

    Application.Dialogs(xlDialogPrint).Show

    I know this probably sounds really dense but how do I assign it to the button?

    I have added the button, right clicked it to add a macro but nothing comes up, I have tried an onclick event but it still does not do it.[/quote]

    You need to first create the Macro.

    Example

    Sub MyPrint()
    Application.Dialongs(xlDialogPrint).Show
    End Sub

    Once created you can asign it to a short cut key or objects.

    In my example when asked to assing select MyPrint

    Regards,

    Tom Duthie

  3. #3
    5 Star Lounger
    Join Date
    Aug 2001
    Location
    Surrey, United Kingdom
    Posts
    1,001
    Thanks
    0
    Thanked 0 Times in 0 Posts
    [quote name='duthiet' post='767276' date='25-Mar-2009 16:04']You need to first create the Macro.[/quote]

    Hi Tom

    Thanks for the response, however all I get is this when I click the button towhich I have assigned the macro
    Attached Images Attached Images
    Cheers

    Steve

    Asking the questions everbody wants the answers too but feels too stupid to ask themselves :-)

  4. #4
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts
    You copied Tom's typo.

    It is Application.Dialogs...

    Not:

    Application.Dialongs...

    Steve

  5. #5
    3 Star Lounger
    Join Date
    Nov 2002
    Location
    New York, New York, USA
    Posts
    266
    Thanks
    0
    Thanked 19 Times in 19 Posts
    [quote name='stevehocking' post='767299' date='25-Mar-2009 13:18']Hi Tom

    Thanks for the response, however all I get is this when I click the button towhich I have assigned the macro[/quote]

    See the attached workbook.

    It works with my Excel and Opens the Dialog Box.

    Regards,

    Tom Duthie
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •