Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
I've got the following code:
Charts.Add Set NewChart = Charts.Add NewChart.ChartType = xlLineMarkers NewChart.SetSourceData Source:=rng2Plot, PlotBy:=xlRows NewChart.Location Whe=xlLocationAsObject, Name:="GraphResults" With NewChart .HasTitle = True .ChartTitle.Characters.Text = Title .Axes(xlCategory, xlPrimary).HasTitle = True .Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = "Date" .Axes(xlValue, xlPrimary).HasTitle = True .Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "Num Errors" End With The code fails at the line ".HasTitle = True". Viewing the NewChart object in the Watch window show the object has NO properties, but I don't understand why since it is dimmed as a chart object. The only way to make this code work is to change it to: Charts.Add Set NewChart = ActiveChart NewChart.ChartType = xlLineMarkers NewChart.SetSourceData Source:=rng2Plot, PlotBy:=xlRows NewChart.Location Whe=xlLocationAsObject, Name:="GraphResults" With NewChart .HasTitle = True .ChartTitle.Characters.Text = Title .Axes(xlCategory, xlPrimary).HasTitle = True .Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = "Date" .Axes(xlValue, xlPrimary).HasTitle = True .Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "Num Errors" End With Can someone explain why this is so? -- | +-- Thief_ | |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Skip some columns when creating a chart | Charts and Charting in Excel | |||
Creating a pie chart | Charts and Charting in Excel | |||
creating an x,y chart | Charts and Charting in Excel | |||
Creating a dynamic chart | Charts and Charting in Excel | |||
Creating an x,y coordinate chart | Charts and Charting in Excel |