LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Multiple chart selection in Excel 2007

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
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
Excel 2007: Selecting multiple objects by drawing a selection box panalysis Excel Discussion (Misc queries) 4 April 2nd 23 07:41 PM
Excel 2007 Chart Data Selection- Arrow Keys Frustration Kerry[_2_] Excel Worksheet Functions 0 April 7th 11 05:00 AM
2007 Excel Workbook multiple worksheets I want 1 chart Dwade Charts and Charting in Excel 2 May 4th 09 05:06 AM
excel 2007 multiple data selection colour Larry North Excel Discussion (Misc queries) 4 May 26th 08 03:02 AM
Chart Selection - Excel 2007 copy to Powerpoint 2007 GS80 Charts and Charting in Excel 1 February 7th 08 01:30 PM


All times are GMT +1. The time now is 06:27 AM.

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

About Us

"It's about Microsoft Excel"