L
Luca Brasi
I am using code like in the sample below to detect if a single chart shape is
selected on the active worksheet and then do some formatting.
But the code does not run properly. Whenever I call a property of the chObj
reference an error occurs. When I do some debugging and put this reference in
the Watch list Excel even crashes.
Using Excel 2007 SP2. Thanks for any hints! Luca
*************************************
Dim chObj As ChartObject
If Windows.Count > 0 Then
If TypeName(ActiveSheet) = "Worksheet" Then
If TypeName(ActiveWindow.Selection)="ChartObject" then
Set chObj = ActiveWindow.Selection
Debug.Print chObj.name
'here some more code to format the chart
End If
End If
End If
*************************************
selected on the active worksheet and then do some formatting.
But the code does not run properly. Whenever I call a property of the chObj
reference an error occurs. When I do some debugging and put this reference in
the Watch list Excel even crashes.
Using Excel 2007 SP2. Thanks for any hints! Luca
*************************************
Dim chObj As ChartObject
If Windows.Count > 0 Then
If TypeName(ActiveSheet) = "Worksheet" Then
If TypeName(ActiveWindow.Selection)="ChartObject" then
Set chObj = ActiveWindow.Selection
Debug.Print chObj.name
'here some more code to format the chart
End If
End If
End If
*************************************