Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
My add-in should process all charts the user currently has selected. Now I
ran into a problem when the user has selected several charts (but not all!) on a worksheet. It looks to me as if there is a bug in the "Selection" object in Excel 2007. Let's say I select two out of three charts on a worksheet and run the sample code below. Instead of the selected charts, the first two charts I inserted into the worksheet are processed. Am I doing something wrong or can someone confirm this is a bug in Excel 2007? Knows someone a workaround? Thanks for any hints, Luca '*** Sample code Sub Test() Dim i As Long Dim obj As Object If Windows.Count 0 Then If TypeName(ActiveSheet) = "Worksheet" Then If TypeName(ActiveWindow.Selection) = "DrawingObjects" Then For i = 1 To ActiveWindow.Selection.Count Set obj = ActiveWindow.Selection(i) If TypeName(obj) = "ChartObject" Then ' toggle legend to show which charts are processed obj.Chart.SetElement IIf(obj.Chart.HasLegend, _ msoElementLegendNone, msoElementLegendBottom) End If Next i End If End If End If End Sub '*** End of code |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel 2007: Selecting multiple objects by drawing a selection box | Excel Discussion (Misc queries) | |||
Excel 2007 Chart Data Selection- Arrow Keys Frustration | Excel Worksheet Functions | |||
2007 Excel Workbook multiple worksheets I want 1 chart | Charts and Charting in Excel | |||
excel 2007 multiple data selection colour | Excel Discussion (Misc queries) | |||
Chart Selection - Excel 2007 copy to Powerpoint 2007 | Charts and Charting in Excel |