Deactivating Printing Message

T

TONYC

When printing a document via a macro can the printing message whic
appears on screen be turned off.

I am using the following command

ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True

Ton
 
G

Guest

here is a sniplet that i saved. i haven't used it yet but
you can try it.
sniplet to turn of alerts such as save a file before close.
Application.DisplayAlerts = False
Worksheets("Report").Delete
Application.DisplayAlerts = True
 
T

TONYC

I tried as you suggested but unfortunately the print message stil
appeared on the screen.

Any other suggestions?

Ton
 
S

SNooGs

Try turning off the screen updating. Really helps speed things up for
me when running alot of code that writes to a sheet etc. as well.

Application.screenupdating = false
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Application.screenupdating = true

Hope this helps.
 
D

Dave Peterson

You can turn off all of the windows screen updates--but it this code stops,
you'll be rebooting your pc:

Option Explicit
Private Declare Function LockWindowUpdate Lib "USER32" _
(ByVal hwndLock As Long) As Long
Private Declare Function GetDesktopWindow Lib "USER32" () As Long
Sub WindowUpdating(Enabled As Boolean)

'Completely Locks the Whole Application Screen Area,
'including dialogs and the mouse.

Dim Res As Long

If Enabled Then
LockWindowUpdate 0
'Unlock screen area
Else
Res = LockWindowUpdate(GetDesktopWindow)
'Lock at desktop level
End If

End Sub

Sub testme01()
Call WindowUpdating(False)
Worksheets("Sheet1").PrintOut
Call WindowUpdating(True)
End Sub
 
Top