ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Event Listeners on a protected chart (https://www.excelbanter.com/excel-programming/336268-event-listeners-protected-chart.html)

James Martin[_2_]

Event Listeners on a protected chart
 
Is there anyway to have event listeners (mouse clicks and moves) on a
chart that is protected? I'm fairly certain it is impossible because
the chart must be active for the events to happen and you can't make
the chart active if it's protected.


Jon Peltier[_9_]

Event Listeners on a protected chart
 
First, hold shift while selecting the chart, to select the chart object
(it's surrounded by white handles, not the usual black handles). Press
Ctrl+1 (numeral one) to format it, and on the Protection tab, uncheck
the Locked checkbox. This will completely unprotect the chart. To
prevent bad things being done to the chart, but still make its mouse
events live, execute these VBA commands:

activechart.ProtectSelection=true
activechart.Parent.protectchartobject=true

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______


James Martin wrote:

Is there anyway to have event listeners (mouse clicks and moves) on a
chart that is protected? I'm fairly certain it is impossible because
the chart must be active for the events to happen and you can't make
the chart active if it's protected.



All times are GMT +1. The time now is 10:19 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com