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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mouse events on a shape

Status
Not open for further replies.

FractalWalk

Technical User
Nov 18, 2002
141
0
0
US

I'm using Excel 2002 and I want to tie a mouse event to a shape. I know that isn't supported and that charts does offer those events. But that solution does not work for what I need to do.

I really need to apply a mouse event to a shape. Is that competely impossible?
 




Why could you not add a ChartObject WITHOUT the Chart Object?

I have a Chart1 Sheet with nothing on it except shapes (NO CHART) but it has the chart events, including the mouse events.

On a blank sheet, activate the Chart Wizard and just add a chart without any data.

Move it to a Location as a Sheet.

Add your shapes.

Have at the mouse events.

Skip,
[sub]
[glasses] [red][/red]
[tongue][/sub]
 
The shapes are freeform drawing shapes.

Uness the Chart sheet does something I don't think it does I can't use it. I need cells visible on the same page. Th e idea is that the shapes are a map and clicking on or mousemove events will populate cells in a standard reporting format allowing users to print off the report or copy/paste the data for analysis.

I also need to be able to zoom in and out on the shapes so the sheet has to be large to hold the shapes as I resize it and it moves around.

I played with Charts and embedded charts and it didn't support what I neded. I've got everything working on an Excel spreadsheet excpet the mousemove events. I've got a work-around but it is ugly and I don't know if it is scalable to the number of shapes I need.
 




Funny, I got it to work for me.

"I played with Charts and embedded charts and it didn't support what I neded."

What did it fail to do?

Skip,
[sub]
[glasses] [red][/red]
[tongue][/sub]
 
Oh, I can embed charts and get mouseevents. That's not the problem. The problem is trying to use charts as an overall solution to what I need.

What I really want to know is if it is at all possible to tie mouse events to a shape. If it is impossible then I will stick with my work-around. If it is possible, then I would like to find out how to do that.

Regarding charts, the chart sheet does allow me to display cells on the same sheet so that isn't an option. That leaves embedding a chart which requires activation. As the user will be constantly toggling between the chart and the sheet, activation becomes an issue. The user has to click twice sometimes or click once depending upon if the chart is activated or not.

Also I can't get it to support various functions I need like ifdentifying the individual shapes within a grouped shape.


 




Then use your work-around.

It would be nice if you'd share your work-around method with us.

Skip,
[sub]
[glasses] [red][/red]
[tongue][/sub]
 


BTW, mouse events work on an IMAGE shape from the Control Toolbox.

Skip,
[sub]
[glasses] [red][/red]
[tongue][/sub]
 
So, are you saying it isn't possible?? I really need to know that before I abandon that effort.

My workaround is to attach a forms textbox to every shape and link them to the underlying shape using a specific naming convention. I then use the mousemove event for each of those individually to do what I need.

The problems with that is the text box is rectangular and my shapes aren't so there are large gaps on the map that trigger no mouse events when the use moves over it. I also have heard that Excel can only handle a limited number of shapes. I already need about 1,000 shapes. I am afraid that adding 1,000 textboxes might cause problems. Not to mention the difficulty of creating, attaching and naming these textboxes.

Because of these issues I would like a better solution, thus my question about mouse events directly on the shapes themselves.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top