Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 18th, 2006, 07:55 AM
Registered User
 
Join Date: Apr 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to gavins_satori
Default Change Cursor when over a cell

How can you change the Mouse cursor/icon when it is over a certain range of cells in Excel. There isn't a mouse mouse event so is this possible? Much appreciate any guidence on this.
Thanks
 
Old April 19th, 2006, 03:19 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 173
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Gavin,

This can't be done in Excel VBA.

In theory you could subclass Excel to try to trap the MOUSEMOVE windows messages, then test to see whether the current mouse co-ordinates are the same as your set of special cells and in in which case set the mouse icon accordingly. In practice, however, subclassing Excel in VBA rarely works as VBA is too slow to process all the messages and Excel tends to crash.

If you were really desparate to get this sort of functionality then you could try looking at writing some custom add-ins for excel in VB / C++ but you're getting a bit out of my depth there and it will be a lot of work to achieve the effect.

HTH,
Maccas

 
Old April 19th, 2006, 06:18 PM
Registered User
 
Join Date: Apr 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to gavins_satori
Default

Thanks for this. What about .net ie: Office Studio. Would this be possible to develop this functionality in that. I have seen other application that use Excel for their front-end, where they are able to control the mouse icon as it moves to a particular cell location. I suppose this was developed in their add-ins ie: C# or similar. Any further clues would be great help on this journey for enlightenment.

Thanks

 
Old April 20th, 2006, 03:47 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 173
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Absolutely. I've not actually tried to use VS.Net but I understand that you can create compiled code that will handle windows messages thereby allowing you to determine when the mouse moves over a certain set of cells.

Since I've not tried this I can't help you much more but I would suggest that if your only programming experience is with VBA then you might find VB.Net easier to pick than C#.Net. They can both, ultimately, do the same things.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Change value in GridView Cell Sheraz Khan ASP.NET 2.0 Professional 2 August 30th, 2007 11:12 AM
How to change the value of one cell in a GridView? [email protected] ASP.NET 2.0 Basics 8 November 19th, 2006 01:12 PM
change cell color martin1 Visual Basic 2005 Basics 2 October 4th, 2006 08:55 AM
Change Cell Color phungleon HTML Code Clinic 2 April 9th, 2006 12:36 AM
Change Cursor Type When Using the Command Object hcweb Classic ASP Basics 2 April 7th, 2004 01:08 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.