Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Chart types

Status
Not open for further replies.

esengul

Instructor
Dec 9, 2004
59
US
i can not make change my chart type in VBA code
could you tell me why?
here is my code
everything works but not my charttype
Set oChart = oexcel.Charts.Add()
oChart.chartType = xlXYScatter
With oChart
.HasTitle = True
.HasLegend = False

.ChartTitle.Characters.Text = "Mercury Deposition Network - Matrix Duplicate Relative Percent Difference"
.Axes(1).HasTitle = True
.Axes(1).AxisTitle.Characters.Text = "January ~ December"
.Axes(3).HasTitle = False
.Axes(2).HasTitle = True
.Axes(2).AxisTitle.Characters.Text = "Relative Percent Difference"
End With
 


Hi,

Have you set a reference to the Excel x.y Object Library?

Skip,

[glasses] [red]Be advised:[/red] The dyslexic, agnostic, insomniac, lays awake all night wondering...
"Is there really a DOG?" [tongue]
 
no i havent and also i dont know how to that
thanks
 
in the vb editor Tools/References -- Microsoft Excel x.y Object Library.

This will be where the xl constants are defined (xlXYScatter is a constant)

Skip,

[glasses] [red]Be advised:[/red] The dyslexic, agnostic, insomniac, lays awake all night wondering...
"Is there really a DOG?" [tongue]
 
i didnt have the "Microsoft Excel x.y Object Library" in the list, i checked the "Microsoft Excel 10.0 Object Library"
And it worked
thanks alot
 


x.y == 10.0 ;-)

Skip,

[glasses] [red]Be advised:[/red] The dyslexic, agnostic, insomniac, lays awake all night wondering...
"Is there really a DOG?" [tongue]
 
duhhhhhhhhh. i am so dumb.
thanks again
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top