Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel.charting
external usenet poster
 
Posts: 12
Default Selective protection of charts - permit only beforedoubleclick?

David -

Use chart events. If it's a chart sheet, right click on the sheet tab
and paste this into the code module:

Private Sub Chart_BeforeDoubleClick(ByVal ElementID As Long, _
ByVal Arg1 As Long, ByVal Arg2 As Long, Cancel As Boolean)
Cancel = True
MsgBox "Run the macro from here"
End Sub

Private Sub Chart_Select(ByVal ElementID As Long, _
ByVal Arg1 As Long, ByVal Arg2 As Long)
ActiveChart.Deselect
End Sub

Naturally replace the message box with something useful. If it's an
embedded chart, you need to use a class module to capture chart events,
but the code above will work in the class module. For advice on embedded
chart events, check out this link:

http://support.microsoft.com/default...b;en-us;213738

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
http://PeltierTech.com/Excel/Charts/
_______

David Powell wrote:

Is it possible to limit a user's interaction with a chart to the
double-click event (from which a macro is run)?
As far as I can make out, Excel's protection facilities are either all 'on'
or all 'off' for chart objects (apart from a .ProtectChartObject property
which addresses the chart frame itself).

If it's not directly possible, I suppose I'm interested in workarounds, but
my customer wanted to have this particular type of of user-interaction. At
present, the chart itself is all that needs to be selected. In future
releases, it would be good to be able to select a chart data point and
provide a report or 'drill-down' view. The design works well without
protection, using the BeforeDoubleClick event: can they be made to work
whilst we lock all control of the chart formatting?





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
selective protection Dave[_6_] New Users to Excel 0 February 27th 08 02:15 PM
Protection of Pivot charts Asiageek Charts and Charting in Excel 0 September 5th 07 12:08 PM
Selective cell protection Trilux_nogo Excel Worksheet Functions 1 May 12th 07 08:29 PM
Selective Protection of a Worksheet DCMyers1 Excel Programming 2 December 30th 03 08:06 PM
Selective protection of charts: permit only BeforeDoubleClick ? David Powell Excel Programming 0 July 14th 03 01:14 AM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"