Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub tester1()
Columns("D:D").Select Charts.Add ActiveChart.ChartType = xlLine ActiveChart.SetSourceData Source:=Sheets("HttpStat"). _ Range("D:D"), PlotBy _ :=xlColumns ActiveChart.Location Whe=xlLocationAsObject, _ Name:="HttpStat" With ActiveChart .HasTitle = True .ChartTitle.Characters.Text = _ "Response Time vs. Measurement Count" .Axes(xlCategory, xlPrimary).HasTitle = True .Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = _ "Measurement Count" .Axes(xlValue, xlPrimary).HasTitle = True .Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = _ "Response Time (ms)" End With End Sub Worked for me. Two changes in the code. Change Columns("D:D") to Range("D:D") in the SetSourceData method. change .HasTitle = False to .HasTitle = True -- Regards, Tom Ogilvy "Jacob" wrote in message ... When I attempt to add a chart using a macro, I receive the following error message... Run-time error '13': Type Mismatch Here is a snippet of the macro... Columns("D:D").Select Charts.Add ActiveChart.ChartType = xlLine ActiveChart.SetSourceData Source:=Sheets ("HttpStat").Columns("D:D"), PlotBy _ :=xlColumns ActiveChart.Location Whe=xlLocationAsObject, Name:="HttpStat" With ActiveChart .HasTitle = False .ChartTitle.Characters.Text = "Response Time vs. Measurement Count" .Axes(xlCategory, xlPrimary).HasTitle = True .Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = _ "Measurement Count" .Axes(xlValue, xlPrimary).HasTitle = True .Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "Response Time (ms)" End With The Macro dies on the 4th line listed. The data that is in column 4 is all number expect for D1 which has a title. Please let me know if you have any advice. Thanks, Jacob D. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Adding line chart w/ 2nd axis to stacked bar chart | Charts and Charting in Excel | |||
Adding to a Macro | Excel Discussion (Misc queries) | |||
Adding % to Bar Chart | Charts and Charting in Excel | |||
Adding data series to chart via macro | Charts and Charting in Excel | |||
Adding a line Chart Type to a stacked-clustered Chart Type | Charts and Charting in Excel |