How to prevent print dialog when using the Excel PrintOut method

When I use the PrintOut method to print the Worksheet object to the printer, the Print dialog box appears (with the file name, destination printer, printed pages, and the Cancel button), although I set DisplayAlerts = False. The code below works in the Excel macro, but the same thing happens if I use this code in a VB or VB.Net application (with the reference changes needed to use the Excel object).

Public Sub TestPrint()
Dim vSheet As Worksheet

    Application.ScreenUpdating = False
    Application.DisplayAlerts = False

    Set vSheet = ActiveSheet
    vSheet.PrintOut Preview:=False

    Application.DisplayAlerts = True
    Application.ScreenUpdating = True

End Sub

EDIT: The answer below sheds light on this (it could be a Windows dialog box, not an Excel dialog box), but does not answer my question. Does anyone know how to prevent its display?

: , . , . , API-. - API , ?

+5
3

" " ", , " xxx on ", ( , ..). , , -" Now print..." , .

, , Excel, Windows. , : a) , b) , c) . , , .

EDIT: : Excel PrintOut. , , .

+1

, : .

sub  test()

 activesheet.printout preview:= false

end sub

, , . ​​

+2

API- , , "" :

  • "" .
  • ,
  • ,
  • Windows, , .

, .

API , , , , "" "", .

+1

All Articles