Turn off "Printing.." message

A

Al

I have a macro that prints a number of single sheets based on a user
generated list of workbooks. If the user has n workbooks listed, this
creates n print jobs, and consequently gets n messages saying “Now printing
page 1…†If n is large, this is kind of a nuisance. Is there a way to turn
off that message?
 
D

Dave Peterson

There are API calls that can freeze your screen so nothing moves. But if
something goes wrong, it's reboot time. I wouldn't use them. I'd live with
minor flashing.

At the top of the module:

Declare Function LockWindowUpdate Lib _
"user32" (ByVal hwndLock As Long) As Long
Declare Function FindWindowA Lib _
"user32" (ByVal lpClassName As String, _
ByVal lpWindowName As String) As Long

In your code:

Sub whatever()
'do stuff

'freeze the screen
hWnd = FindWindowA("XLMAIN", Application.Caption)
LockWindowUpdate hWnd

'do more stuff

'unfreeze the screen
LockWindowUpdate 0

'do more stuff

End sub

Remember to save your work often (in all open applications!) if you use this.
You may be rebooting more than you want. (I wouldn't use this--but I've said
this before.)
 
J

Jim Thomlinson

Have you ever used it. I read about it... considered it for a moment... and
then promptly chickened out.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top