Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2004
    Posts
    40

    Unanswered: printing an excel file from code, set default printer ??

    Hi,

    i'm having trouble with this. Sometimes a popup is presented to select a printer although i have set ( changed ) the default printer with :

    SetDefaultPrinter (Forms!frm_O!cboPrinters)

    The code used for opening the excel file and print is :

    Dim exl As New Excel.Application
    Dim xls As Excel.Workbook

    exl.Visible = False
    Set xls = exl.Workbooks.Open(bestand)
    xls.ActiveSheet.PrintOut
    xls.Close
    exl.Quit
    Set xls = Nothing
    Set exl = Nothing

    Other application such as Adobe PDF Reader or jpg files are printed directly.

    Is there a way to pass on the printer used in the second part of code shown above ?
    Or is there another way , perhaps a shell command, which can print also ??

    Thanks in advance
    Bye Erwin

  2. #2
    Join Date
    May 2005
    Posts
    1,191
    Microsoft has an article on how to change the printer in Access, I'm sure it can be adapted for an Excel App fairly readily.
    Me.Geek = True

  3. #3
    Join Date
    Feb 2004
    Posts
    40
    Hi,

    no this did not help. To be clear it is not an excel app. I just want to print an excel file from an access database.

    All goes well ( doc / jpg ) except excel ...

    Thanks in advance
    Bye Erwin

Posting Permissions

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