LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 4
Default Removing unnamed Legend lines from an Excel template

I have created an Excel template with a maximum number of 10 series.
The worksheet is populated with series data from an Access application.

Everything works fine in terms of getting the data from Access to Excel
and then having the chart created.

The problem is that if 9 or fewer series are sent to the template, the
Legend still shows all ten series even though the chart shows only the
actual number of series. The "extra" series shown in the Legend do not
have a name.

I want to remove these 'extra' series from the Legend. I think it
would be easier to do this within the Excel template than to try to do
this from MS Access. In the Chart_Activate procedure

I tried looking for .SeriesCollection(i).Name = "" or
IsNull(.SeriesCollection(i).Name), but errors are generated in both
cases.

Then I thought, why not just trap the error and delete the unnamed
Legend item in the error handler using:
ActiveChart.Legend.LegendEntries(i).Delete

This actually worked, UNTIL, I activated the chart a second time. Then
I started getting an error because apparantly the series count actually
is ten even though only the number of series actually sent from Access
are charted.

Any thoughts on how I can reset the legend in the Excel template to
only display the actual number of series that are being plotted (even
though the template is set up to display ten).

Thanks.

 
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
Opening Excel barry Setting up and Configuration of Excel 11 December 6th 06 10:30 PM
importing links from access to excel to template jwr Links and Linking in Excel 1 February 5th 06 06:42 PM
Sending from excel to word template pizdus Excel Discussion (Misc queries) 0 January 17th 06 05:57 PM
Add more lines and more columns in Excel Marc Charbonneau Excel Worksheet Functions 3 January 20th 05 03:44 AM
balance sheet template in excel adding lines JMJM Excel Discussion (Misc queries) 1 December 1st 04 11:23 PM


All times are GMT +1. The time now is 07:19 AM.

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

About Us

"It's about Microsoft Excel"