Disabling automatic hourglass cursor whilst VB Code running

G

Guest

I have been experimenting with Application.Ontime to run a Sub Routine once
per second (or whatever time interval) to update a Graph.
Using Application.ScreenUpdating = False in the Sub Routine to minimise
flicker.
Every second, as Sub Routine runs the Cursor changes from whatever it was
(crosshair, arrow, I beam etc) to Hourglass for a split second.
Any suggestions how this cursor feature be disabled in the Sub Routine or
via some other setting option ?

Thanks
 
G

Guest

At the start and end of your refresh routine try:-

Application.Cursor = xlNorthwestArrow

Your routine

Application.Cursor = xlNormal


Mike
 
G

Guest

Thanks for this but I have tried using the Application.Cursor in the sub
routine.

Despite putting it in Code still see a visible change. Trying to hide this
entirely from the user.

Its a minor irritation but I was taking it as a challenge to eliminate.

Issues are :

(a) The cursor may be the northwest arrow, or the I beam, or cross hairs
whilst the user is working on the sheet. So in the background every second or
so when the Sub Routine kicks in they "see" the cursor flick to the hourglass
and then back again. My only guess I would have to make the Sub Routine
"remember" what the cursor type was when/prior to the Sub Routine being
called and try to force it to stay at that.

(b) I am not sure whether the hourglass is coming up because of the Sub
Routine or because of Excel updating the graph (after the Sub Routine is
finished). ie if I tell the Cursor to go back to Normal at the end of the Sub
Routine it may be irrelevant because it is changed outside the Sub Routine as
the graph updates?

Thanks again.
 
B

blackbox via OfficeKB.com

I changed it to

Application.Cursor = xlNormal

Your routine

Application.Cursor = xlNormal

works this way except that when you move the cursor or a command button it
changes to the hour glass and stays that way.


David said:
Thanks for this but I have tried using the Application.Cursor in the sub
routine.

Despite putting it in Code still see a visible change. Trying to hide this
entirely from the user.

Its a minor irritation but I was taking it as a challenge to eliminate.

Issues are :

(a) The cursor may be the northwest arrow, or the I beam, or cross hairs
whilst the user is working on the sheet. So in the background every second or
so when the Sub Routine kicks in they "see" the cursor flick to the hourglass
and then back again. My only guess I would have to make the Sub Routine
"remember" what the cursor type was when/prior to the Sub Routine being
called and try to force it to stay at that.

(b) I am not sure whether the hourglass is coming up because of the Sub
Routine or because of Excel updating the graph (after the Sub Routine is
finished). ie if I tell the Cursor to go back to Normal at the end of the Sub
Routine it may be irrelevant because it is changed outside the Sub Routine as
the graph updates?

Thanks again.
At the start and end of your refresh routine try:-
[quoted text clipped - 16 lines]
 

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