LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
bj bj is offline
external usenet poster
 
Posts: 1,397
Default Setting Chart series

I am receving an "Automation error" when running the following cose using
EXCEL as an automation client from ACCESS.

The embedded chart is created normally but I have been unable to set the
data series.

The code works normally untill it starts to set the data series. Any ideas

xl_wkb.Charts(1).ChartType = xlColumnStacked
xl_wkb.Charts(1).Location Whe=xlLocationAsObject,
Name:="qry_Rep-1-01-Output"

Set xl_Chart = xl_wkb.Worksheets(1).ChartObjects(1).Chart
With xl_Chart

For int_Count = 1 To .SeriesCollection.Count
.SeriesCollection(int_Count).Delete
Next

Set rng_Data = xl_wkb.Worksheets(1).Range("A1")
Set rng_Data = rng_Data.CurrentRegion

For int_Count = 3 To rng_Data.Columns.Count ' 3rd column is first
data column
.SeriesCollection.NewSeries
str_Values = "='qry_Rep-1-01-Output'!" &
rng_Data.Columns(int_Count).Offset(1).Address
str_Name = "='qry_Rep-1-01-Output'!" & rng_Data.Cells(1,
int_Count).Address
.SeriesCollection(int_Count - 2).Values = str_Values
.SeriesCollection(int_Count - 2).Name = str_Name
Next int_Count

.SeriesCollection(1).XValues = rng_Data.Columns(1).Address.Offset(1,
rng_Data.Rows.Count - 1)
.HasTitle = True
.ChartTitle.Characters.Text = "Project By Resource Code - Baseline
Data"

With .Axes(xlCategory, xlPrimary)
.HasTitle = True
.AxisTitle.Characters.Text = "Months"
End With
With .Axes(xlValue, xlPrimary)
.HasTitle = True
.AxisTitle.Characters.Text = "People"
End With
 
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
Setting Up a Series of Formulas Pepper Excel Worksheet Functions 9 February 18th 09 11:52 AM
VBA - Setting up a Chart series C Brandt Excel Discussion (Misc queries) 4 August 6th 07 10:03 PM
Setting Excel chart series from vb6 Jim Charts and Charting in Excel 7 January 27th 06 09:41 AM
Setting Series data in VBA [email protected] Charts and Charting in Excel 4 March 11th 05 01:44 PM
Setting chart series XValues in foreign language Gail Hurn Excel Programming 9 December 15th 04 09:47 AM


All times are GMT +1. The time now is 02:34 PM.

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"