how to close Printer status bar

  • Thread starter how to close Printer status bar
  • Start date
H

how to close Printer status bar

HI,
I Open a Excel File with 'Excel.Application', then print Active WorkBooks.
this ExcelApplication show a dialog Mesage with 'pRING THE FIRST PAGE TOTAL
PAGES 2 ..........' .THIS IS A USEFULL MESSAGE,BUT In my programe. i don't
need.
please help me how to close this message.
 
D

Dave Peterson

Excel can't control this. But you can use an API.

Saved from a previous post:

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.)
 

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