A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Charts and Charting
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Series Hyperlink or something like it



 
 
Thread Tools Display Modes
  #1  
Old March 3rd, 2004, 02:26 AM
Kaiyang
external usenet poster
 
Posts: n/a
Default Series Hyperlink or something like it

hi people,

I have created a new chart-sheet with 3 series on it. What I wanted to do is that when i click on the series, i will want the excel to run another piece of codes and generate another graph that is related.

I do not know whether it's possible but if not is there anyway i can make any "interaction" such as using dialog box, msgbox when click on the chart?

One more thing i need to remind, is that the charts are generated from codes, not plotted manually. So there is no way to code in the charts before it's generated.

Thank You
  #2  
Old March 3rd, 2004, 01:45 PM
Jon Peltier
external usenet poster
 
Posts: n/a
Default Series Hyperlink or something like it

Kaiyang -

You can have a class module in the workbook that enables chart events:

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

It usually is used for events in embedded charts, which are not backed
up by a code module in the workbook's VBA project. But it can be applied
to chart sheets as well. In step 8 of the MSKB article, use this code
instead:

Sub Set_Chart()
Set mychart.EmbChart = ActiveChart
End Sub

You could alternatively set up an application events class that, when a
sheet is activated, enables events for the chart (if it's a chart sheet)
or for any embedded charts on the sheet (chart sheet or worksheet).

You could also have your code write the chart event procedure behind the
chart sheet it creates.

Finally you need an event procedure in the chart events class module
that detects a click on a series or point:

Private Sub EmbChart_Select(ByVal ElementID As Long, _
ByVal Arg1 As Long, ByVal Arg2 As Long)
MsgBox "You've selected chart element " & ElementID & _
" (" & Arg1 & ", " & Arg2 & ")."
End Sub

If ElementID is that of a series, Arg1 is the series number and Arg2 is
the point. I have some of this on my web site:

http://peltiertech.com/Excel/Charts/...html#PointInfo

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

Kaiyang wrote:

hi people,

I have created a new chart-sheet with 3 series on it. What I wanted
to do is that when i click on the series, i will want the excel to
run another piece of codes and generate another graph that is
related.

I do not know whether it's possible but if not is there anyway i can
make any "interaction" such as using dialog box, msgbox when click on
the chart?

One more thing i need to remind, is that the charts are generated
from codes, not plotted manually. So there is no way to code in the
charts before it's generated.

Thank You


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:44 PM.


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