Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default SendKeys and Application.ScreenUpdating

I have a module in which I'm using SendKeys to change a printer
property. At the beginning of the module, I have
Application.ScreenUpdating = False so hide the various dialog boxes
that open and close during the process. The problem is that the
ScreenUpdating command looks to be ignored as I can see everything that
is happening.

Any help is appreciated.

TIA,
Mike.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default SendKeys and Application.ScreenUpdating

What you can do is use API calls to freeze the screen. This freezes the
screen better, but has the drawback that if something goes wrong you are
stuck with a frozen screen and have to come out with Ctrl + Alt + Del. Also
you have to unfreeze the screen before for example a MsgBox.

Put this in the declarations (top of the module):

Private Declare Function LockWindowUpdate Lib "USER32" (ByVal hwndLock As
Long) As Long
Private Declare Function GetDesktopWindow Lib "USER32" () As Long

Then put this Sub somewhere in your module:

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

Then use it in your code like this:

WindowUpdating (False) 'to freeze the screen

or:

WindowUpdating (True) 'to unfreeze the screen



RBS





"Michael Malinsky" wrote in message
oups.com...
I have a module in which I'm using SendKeys to change a printer
property. At the beginning of the module, I have
Application.ScreenUpdating = False so hide the various dialog boxes
that open and close during the process. The problem is that the
ScreenUpdating command looks to be ignored as I can see everything that
is happening.

Any help is appreciated.

TIA,
Mike.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 339
Default SendKeys and Application.ScreenUpdating


"Michael Malinsky" wrote in message
oups.com...
I have a module in which I'm using SendKeys to change a printer
property. At the beginning of the module, I have
Application.ScreenUpdating = False so hide the various dialog boxes
that open and close during the process. The problem is that the
ScreenUpdating command looks to be ignored as I can see everything that
is happening.

Any help is appreciated.

TIA,
Mike.


Application.ScreenUpdating = False will only prevent the cells from showing
updated values.

/Fredrik


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default SendKeys and Application.ScreenUpdating

I tried your suggestion, but I can still see the all of the print
dialogs pop up from the SendKeys commands. If I step through it, the
desktop freezes, but when I run the module, it doesn't seem to work.

Any ideas on what I'm missing?

Thanks,
Mike.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Application.ScreenUpdating problem jkitzy Excel Programming 3 January 12th 05 09:27 PM
Question on application.screenupdating augustus Excel Programming 2 December 18th 04 01:35 AM
problem with Application.ScreenUpdating Betty[_2_] Excel Programming 8 July 23rd 04 09:51 PM
Application.ScreenUpdating malfunction Tom Deiley Excel Programming 1 June 18th 04 03:59 PM
Application.ScreenUpdating = False Pieter Kuyck Excel Programming 2 July 15th 03 06:28 PM


All times are GMT +1. The time now is 04:43 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"