Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Setting Up a Series of Formulas | Excel Worksheet Functions | |||
VBA - Setting up a Chart series | Excel Discussion (Misc queries) | |||
Setting Excel chart series from vb6 | Charts and Charting in Excel | |||
Setting Series data in VBA | Charts and Charting in Excel | |||
Setting chart series XValues in foreign language | Excel Programming |