Cursor remains as a hourglass after the macro has run

Darril

New Member
Joined
Nov 15, 2005
Messages
10
Clicking a command button causes a macro to run.
Once the macro has completed, my cursor remains as a hourglass whilst still positioned over the button. If I move the cursor off the Button, it reverts to its default shape. I want the hourglass cursor to change after the macro has completed without having to move the mouse.

I inserted the following code at the end of the macro:

Application.Cursor = xlDefault

but this did not make a difference. With the cursor as an hourglass, the user thinks the macro is still running.
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.

Andrew Poulsom

MrExcel MVP
Joined
Jul 21, 2002
Messages
73,092
What's csusing the cursor to change into an hourglass? Would selecting a cell in your code solve your problem?
 

Darril

New Member
Joined
Nov 15, 2005
Messages
10
Hi Andrew
Its a macro that cals other macros and runs through its own code.
Selecting another cell in the macro does not solve the problem bacause the cursor stays where it is ie the cursor depressed the button and turns to a hourglass whilst the macro runs but it stays as a hourglass after the macro has finished. If I move the mouse, the cursor changes back to its default shape - nothing in the code makes the cursor change to an hourglass.
Ta
 

erik.van.geit

MrExcel MVP
Joined
Feb 1, 2003
Messages
17,832

ADVERTISEMENT

Hi,

If I move the mouse, the cursor changes back to its default shape
and when you move back to the button does it return to an hourglass ?

kind regards,
Erik
 

Darril

New Member
Joined
Nov 15, 2005
Messages
10
Hi Andrew
I could send you the spreadsheet but that would not be fair to you - I could also cut and paste the code here but that may not help as there are associated routines that I call - the problem is that I am getting this on two different buttons but I do not get it when the code is much simpler where other routines are not called.

I also use application.screenupdating = false or true and maybe that is the problemit is sticking on that?
Part of the routing uses the Worksheet_Change() utility and this may also be preventing the cursor changing back from a hourglass
Thanks
 

Darril

New Member
Joined
Nov 15, 2005
Messages
10

ADVERTISEMENT

Hi Erik
Moving it off the button changes to normal and the hourglass does not reappear if I move the cursor over the button again
Thanks
 

erik.van.geit

MrExcel MVP
Joined
Feb 1, 2003
Messages
17,832
what do you get when doing a search in your projectcode for
"mousepointer" or "hourglass"
is there any LostFocus code in the commandbuttoncode ?
or other suspicious code ?

feel free to send your workbook if this reply is not solving anything

EDIT: didn't see Andrews reply asking about the same
 

Darril

New Member
Joined
Nov 15, 2005
Messages
10
Hi Erik
I can send you the spreadsheet no problem - except that I dont know how to post the worksheet.
I have no lostfocus code and I do nothing with the mouse cursors
Thanks
 

Forum statistics

Threads
1,136,366
Messages
5,675,354
Members
419,564
Latest member
Phil57

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top