How would I make textboxes / autoshapes unclickable?

phil152003

Board Regular
Joined
Mar 11, 2011
Messages
89
I have a scatter chart (object in a worksheet). I have split the graph area into quadrants using autoshape lines. In each quadrant of the chart, there is a textbox describing what points in that quadrant represent.

Now, I have implemented some code (that someone else from this forum has helped me with) that allows me to click on a data point in the chart and a popup label appears for the duration of the mousepress. However, if the datapoint coincides with one of the autoshape lines or a textbox, then when I go to click the datapoint, it selects the line/textbox instead of the point.

I want to know if there is a way using VBA to "lock" these textboxes/lines into the graph, making them unclickable to allow no interation with them.

I'm not particularly experienced with VBA, so if you could tell me exactly what code I need, and where exactly I have to put it then that would be greatly appriciated.

Thanks!
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Just a thought .

Assign a dummy Macro to the autoshapes just by right clicking on them and choosing Attach Macro/New/Ok. This should at least prevent them from being selected.
 
Upvote 0
Annoyingly, both of those suggestions don't work. Yes, they make the boxes / shapes unclickable, but Excel still registers that they are there. This means that when a data point overlaps with a textbox / line, the command not to select the text box overrides the command to instead click the data point (if that makes any sense?!)

I've found a way to remove the autoshape bars, and have them automatically appear on the graph instead:

(Link here: if anyone is interested http://theclosetentrepreneur.com/how-to-add-a-vertical-line-to-an-excel-xy-chart )

But the problem still reamins for the textboxes!
 
Upvote 0
You could remove the chart's plotarea and chartarea fills and then put the textboxes behind the chart?
 
Upvote 0
That works up until the point when I click on the chart to select a datapoint. The text boxes then disappear one I have clicked on the chart!
 
Upvote 0
The only other thing I can think of would be to create an image file of the appropriate size with your 4 bits of text placed in each quadrant. Then set that as the fill for the plot area.
 
Upvote 0
I literally just had that idea myself! I'm going to attempt it now, I shall get with (hopefully promising results).
 
Upvote 0
Works fine in my quick tests before posting. :)
 
Upvote 0
Well in principal it works and looks very good! However, whenever I click down on a point the graph flickers uncontrollably for 1-2 seconds. Its just one problem after another with this **** chart!
 
Upvote 0

Forum statistics

Threads
1,222,404
Messages
6,165,856
Members
451,987
Latest member
Johnzdz

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
Back
Top