+ Reply to Thread
Results 1 to 9 of 9

Change default printer

  1. #1
    Valued Forum Contributor
    Join Date
    05-14-2009
    Location
    gold coast
    MS-Off Ver
    Excel 2007
    Posts
    843

    Change default printer

    I have got a buttion that changes various layout and borders for the page then shows a printpreview, after printprewiew closes.
    Then a msgbox that askes if you would like print. Is there a way to change the defult printer between local printer and adobe distiller(.pdf) as a dropdown option box. Or Yes for Local printer and NO for adobe distiller(.pdf) using vbYesNoCancle.
    Cheers
    Last edited by D_Rennie; 05-18-2009 at 08:30 AM.

  2. #2
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,523

    re: Change default printer

    Can you change this to fit your needs?

    Please Login or Register  to view this content.
    Or give yourself a choice of printers

    Please Login or Register  to view this content.

  3. #3
    Valued Forum Contributor
    Join Date
    05-14-2009
    Location
    gold coast
    MS-Off Ver
    Excel 2007
    Posts
    843

    re: Change default printer

    Thankyou jolivanes.
    The Second code works like a treat. Though when i place it into my current code it will try and print on both vb yes or no. how can i stop it from printing if no is clicked.

    Please Login or Register  to view this content.
    Also with,
    Please Login or Register  to view this content.
    How can this be removed after print.

    Cheers again.

    ++Edit++
    I think i see it now.
    If response = vbYes (should remain Range("A12", Range("A65536").End(xlUp).Offset(0, 9)).PrintOut Copies:=1, Collate:=True)

    And could use If response = vbNo (Application.Dialogs(xlDialogPrinterSetup).Show)
    though then i would need 2 msgbox or is there a way to keep the msgbox up untill either yes or cancel is pressed so it works with new defult printer.

    Hope thats not confusing, Me thinking out loud.
    Last edited by D_Rennie; 05-17-2009 at 01:32 PM. Reason: more info

  4. #4
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,523

    Re: Change default printer

    The ranges are just what I have in my workbook and the page setup could be deleted from the code if you don't want it.
    On your options to print or not to print I think the way to go is:
    Please Login or Register  to view this content.
    Someone else might have better solution though as most of my code I copy from these forums and change it to fit my needs.
    HTH
    John

  5. #5
    Valued Forum Contributor
    Join Date
    05-14-2009
    Location
    gold coast
    MS-Off Ver
    Excel 2007
    Posts
    843

    Re: Change default printer

    I think its nearly there though the problem may be that i dont want it to exit sub cos there is code after it.

    here is the code the print part is in the ''''''''''' '''''''''' lines.
    Sub Button1_Click()
    With ActiveSheet

    Please Login or Register  to view this content.

    thankyou for all the halp so far.

  6. #6
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,523

    Re: Change default printer

    You can go the other way around. If yes, then print, else do something else, in this case continue with your code.
    HTH
    John

  7. #7
    Valued Forum Contributor
    Join Date
    05-14-2009
    Location
    gold coast
    MS-Off Ver
    Excel 2007
    Posts
    843

    Re: Change default printer

    Cant get it to work, Ive only been uing excel for a week, Im still stumbling around with it.
    I will put up the file if you would like to have a look at it.
    Cos there is more issues that are probley real easy to fix.
    ive put the problems in '''''' ''''''''' border things
    there is also some error message ill put a .jpg file incase you dont get it on your computer.

    i appoligise for all the trouble.

    the hide colum problem is not h:k like in file
    #code#'''''''''''''''''''''''''''''''''''''''''''
    '''if i insert this it hides from A:k
    Columns("B:B").Select
    Selection.EntireColumn.Hidden = True
    ''''''''''''''''''''''''''''''''''''''''''''#code#
    Attached Images Attached Images
    Attached Files Attached Files
    Last edited by D_Rennie; 05-18-2009 at 02:27 AM. Reason: spelling

  8. #8
    Valued Forum Contributor
    Join Date
    05-14-2009
    Location
    gold coast
    MS-Off Ver
    Excel 2007
    Posts
    843

    Re: Change default printer

    bump, still cant figure it out.
    got the colum figured out YAH
    changed From
    Columns("B:B,H:K").Select
    Selection.EntireColumn.Hidden = True

    TO
    Columns("H:K").EntireColumn.Hidden = True
    Columns("B:B").EntireColumn.Hidden = True
    Last edited by D_Rennie; 05-18-2009 at 07:51 AM.

  9. #9
    Valued Forum Contributor
    Join Date
    05-14-2009
    Location
    gold coast
    MS-Off Ver
    Excel 2007
    Posts
    843

    Thumbs up Re: Change default printer

    SOLVED

    Please Login or Register  to view this content.
    It may not be prity though it works.

    THANKYOU FOR THE HELP. 5 THUMBS UP

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1