PDA

View Full Version : VBA Access - Hide Chart SereisCollection



Kpatel
03-15-2005, 04:32 AM
Hi,



I am facing difficulty in hiding a series collection. I am using Ms Access 2002, MDAC 2.8 and Windows XP Professional. Currently use the following code to color them, this works:



oChart.SeriesCollection(1).Interior.Color = ?Red?



I have tried the following code with no success:

oChart.SeriesCollection(1).Interior.Color = ?None?

oChart.SeriesCollection(1).Interior.Color = ?xlNone?

oChart.SeriesCollection(1).Interior.Color = ?false?

oChart.SeriesCollection(1).Interior.Color = ?0?





I can change the seriescollection color so that it matches the background thus camouflaging it, but this method does not hide it efficiently.



Is there are method, function or color attribute equivalent to that of when you manually set the color to ?None??



Any comments you have on this will be appreciated.



Thanks



Keyur

Andy Pope
03-15-2005, 05:05 AM
Hi Keyur,

Should the Color property be a value? Are you sure "RED" works?

How about something like this, which works in Excel.

oChart.SeriesCollection(1).Interior.Color = oChart.Plotarea.Interior.Color

Kpatel
03-15-2005, 06:18 AM
Andy,

I used your appraoch but went a step further and extracted the plot are color value after I manually set to 'none', it worked! The 'none' color value is equal to VB color -2, the code below worked:

oChart.SeriesCollection(1).Interior.Color = -2
oChart.SeriesCollection(1).Border.Color = -2

The above code should will make the interior and border color equal none.

Cheers

Keyur