Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Application- / Workbook-Level EventHandler for MouseOver

Status
Not open for further replies.

innov

Programmer
May 20, 2004
40
US
Hey Folks.

SETUP:
I know how to:
(a) use image mouseover events within a worksheet module; and
(b) How to invoke/use an application-level eventhandler to track application-wide worksheet & workbook events..

QUESTION:
Is there a way to create an application-level or workbook-level eventhandler that tracks image mouseovers in multiple / all worksheets?

REASON:
I have a workbook that controls multiple simple .xlsx workbooks and want to track image mouseovers in those workbooks/sheets. (Hope it's possible!!)

THANKS IN ADVANCE!
 


hi,

While there are in the ThisWorkbook Object, Workbook_Sheet events, there do not seem to be events exposed for the control objects on the sheets.

I do not know if you can add a class module to coordinate such events.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 


I have a workbook that controls multiple simple .xlsx workbooks and want to track image mouseovers in those workbooks/sheets.
Could you elaborate? When the user is mousing in a workbook/sheet, what control does your said workbook have?

Could you not record your mouseovers in some way in each workbook and READ the results from your said workbook?

As previously requested, elaborate on the reason/data/process.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Hi Skip. Thanks for the quick reply.
I trying to detect mouseover events in OTHER workbooks without putting vba code in them (and therefore needing them to be .xlsm files). I was hoping to put activex image controls in them (without code) and then monitor the mouseovers from my main application workbook.

I currently use an application-level eventhandler (Dim withEvents xlApp as Apllication) to monitor sheetchanges, activate/deactivate, etc) but as you may know, no events for controls are exposed. So wondered if there was a way.

Hope that's clearer.
 


Nope!

Reasons for no vba?

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
I don't want to get into philosophies but suffice it to say that I have a vested interest in keeping my licensed code centralized.
 


Then write your own application. Excel is not the best tool for protecting your code.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Anyone else have an answer to the technology question. Skip, its been awhile but I usually was impressed by your vba prowess. Having a bad day?
 


O L. Guess the shine is off the rose. ;-)

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
You can use an application level event handler(s) to pick the MouseOver events of objects that can raise this event.
General idea:
- create class modules with WithEvents declarations of classes you plan to use (chart, msforms image etc),
- destroy objects based on deselected sheet,
- test selected sheet if contains objects that you are interested in,
- if so, instantiate objects basing on selected sheet.
You could find my vba event faqs helpful.

I totally agree with Skip that excel is not the best tool for protecting your code


combo
 
Thanks, Combo.

Let me experiment with this concept and I'll report back.

For the record, I ALSO agree that it's not the best for code protection. I had reasons for being tied into this platform in the beginning (no good excel grid controls for .net at the time, etc.), and I am migrating, but in the meantime....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top