If I understood the question, I faced the same problem. Whenever there are several overlapping charts, their visualization precedence follows the ZOrder
.
In Excel 2003, when one selected a chart, it came to the foreground (at least for visualization, I do not know whether its ZOrder
was temporarily changed). When the chart was deselected, its visualization precedence returned to "normal".
Starting with Excel 2007, charts do not temporarily come to foreground for visualization when selected, so if they are buried behind other charts (or possibly other Shape
s), the only option to see them in full is to bring them to front. This has two downsides: 1) more clicks are needed, 2) the (possibly intended) ZOrder
is lost.
Even Jon Peltier, in a post from 5th May 2009, mentioned that there is no workaround for that.
I have attempted a solution based on:
- Detecting the activation of a chart.
- Storing its current
ZOrder
for later use.
- Bringing it to front.
- After deselecting the chart, restoring its original
ZOrder
.
This is the basic idea, and the scheme works fairly well, with a few glitches. I have actually based my code on the page by Jon Peltier quoted here by brettdj.
One of the modifications is
Private Sub EvtChart_Activate()
Application.EnableEvents = False
ActivatedChart = EvtChart.name
If (TypeName(EvtChart.Parent) = "ChartObject") Then
' Chart is in a worksheet
Dim chObj As ChartObject
Set chObj = EvtChart.Parent
chObj.BringToFront
Else
' Chart is in its own sheet
End If
Application.EnableEvents = True
End Sub
Use something similar for EvtChart_Deactivate
.
I hope that the idea is useful.