Mouse pointer

S

Simon Lloyd

Does anyone know how to hide the mouse pointer during a sheet updat
where normally it would flicker even if you turn screen updating off,
want to hide the mouse pointer during an auto close and then turn i
back on at the end of the close so that its there for use again i
every other program.....I have tried the VB version of Showcursor bu
it didnt seem to work!

Hoping you can help!

Simo
 
R

Rob Bovey

Hi Simon,

You can prevent the mouse cursor from flickering by simply forcing it to
be an hourglass during code execution and then setting it back to default
when you're done, like so:

Sub Auto_Close()
Application.Cursor = xlWait
''' Your code her.
Application.Cursor = xlDefault
End Sub

--
Rob Bovey, MCSE, MCSD, Excel MVP
Application Professionals
http://www.appspro.com/

* Please post all replies to this newsgroup *
* I delete all unsolicited e-mail responses *
 
D

David McRitchie

Hi Simon,
And if something went wrong what you do not knowing where the
mouse is. It is customary to have the mouse change to an hourglass.

A search turns up the following started with
cursor hourglass
then modified to
cursor hourglass xlwait
see
http://google.com/[email protected]
 
S

Simon Lloyd

Guys, thanks for your responses.......i do understand that an hour glas
is the accepted way but my problem is this.......while updating all 2
sheets the mouse pointer flickers and just before it changes sheet t
update the next the mousepointer stops being an hourglass and becomes
pointer again for about 10secs allowing the user to select cells or go
forbid click cancel or exit during the autoclose (for some reason i
you select another application or say taskbar, then it interrupts th
macro and it ends prematurely!).

This is why i want to hide the mouse button!.....but if you hav
another solution im willing to give it a go!

Simo
 
D

David McRitchie

I made up a test to change mouse pointer to an hour glass, and changed
sheets, the mouse did not change by switching sheets.

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Cancel = True
If Application.Cursor = xlDefault Then
Application.Cursor = xlWait
Else
Application.Cursor = xlDefault 'return normal pointer
End If
End Sub

If you are running a macro, I don't see how the user can do anything
in the meantime. Are you running another macro after a time interval.
Also is it really necessary to switch sheets in your macro.
 
S

Simon Lloyd

Hi David, and thanks again!

I have 20 sheets that on auto close look for a value in a cell in rang
I3:V461 (or something in the region, it's different on each sheet so i
upates by checking cells in a list) and then enters a date on the sam
sheet in an offset and when it has done this the value in the origina
cell checked has its colour changed........so when it is checking
sheet on update the mouse pointer flickers once checked it pauses whil
it updates and at this point the pointer is normal in every way, the
it moves on to the next sheet with the same criteria.......so thats th
problem i have i can send you all the code in the workbook in tex
format if you wish or mail you the whole workbook and you can see wha
i've done....maybe you can use some of the code...but being an MPV
doubt it!!!

SImo
 
Top