ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Disabling automatic hourglass cursor whilst VB Code running (https://www.excelbanter.com/excel-programming/390686-disabling-automatic-hourglass-cursor-whilst-vbulletin-code-running.html)

David Messenger

Disabling automatic hourglass cursor whilst VB Code running
 
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


Mike H

Disabling automatic hourglass cursor whilst VB Code running
 
At the start and end of your refresh routine try:-

Application.Cursor = xlNorthwestArrow

Your routine

Application.Cursor = xlNormal


Mike

"David Messenger" wrote:

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


David Messenger

Disabling automatic hourglass cursor whilst VB Code running
 
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.

"Mike H" wrote:

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

Application.Cursor = xlNorthwestArrow

Your routine

Application.Cursor = xlNormal


Mike

"David Messenger" wrote:

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


blackbox via OfficeKB.com

Disabling automatic hourglass cursor whilst VB Code running
 
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 Messenger wrote:
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]

Thanks


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200706/1



All times are GMT +1. The time now is 05:27 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com