Zum Hauptinhalt gehen

Suche

Suche

Vba Printing With If Statement

Kommentare

3 Kommentare

  • Avatar
    Shotaro Ito

     
    I am trying to automate the closing of Bartender with Excel VBA code.  Basically, if the operator presses the "Print" button on the print dialoug screen, I was the program to close.  But I want the operator to pull the print dialoug screen up them selves and the VBA code wait on the operator's input. 

     

     

    Hi,

    Void Format.PrintOut(<show progress dialog>,<show print dialog>) 

    Print out doesn't return value, so you cannot use that in IF condition.

    If you want to pick error, then use Format.Print().

     

    When you want to show print dialog and quit BarTender after print, that would be

    btApp.VisibleWindows = btInteractiveDialogs
    btApp.ActiveFormat.PrintOut(True, True)
    btApp.Quit (btDoNotSaveChanges)
    
    0
  • Avatar
    Legacy Poster

    If the Print out does not return a value, then I am not sure if I can do what I want to do. 

     

    Basically,

     

    When print button is pressed, then close.  I don't want the print dialog to show up automatically because the operator views the print preview first.  Only if the print button is pressed, then close the program.

    0
  • Avatar
    Shotaro Ito
    btApp.ActiveFormat.PrintOut(True, False)
    btApp.Quit(btDoNotSaveChanges)

    above would not show print dialog, just print. (in your code, "False" spelled wrong)

    0

Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.