G
Guest
Hi people
I had tried using Marco Recorder to get the codes required for plotting a chart
It appears that the codes are given incorrectly, there are certain part of the codes have runtime error
===============================================
Charts.Ad
ActiveChart.ApplyCustomType ChartType:=xlBuiltIn, TypeName:=
"Line - Column on 2 Axes
==================================================
ActiveChart.Location Where:=xlLocationAsNewSheet, Name:="asdasd
With ActiveChar
.HasTitle = Tru
.ChartTitle.Characters.Text = "charttitle
.Axes(xlCategory, xlPrimary).HasTitle = Fals
.Axes(xlValue, xlPrimary).HasTitle = Tru
.Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "prod
.Axes(xlCategory, xlSecondary).HasTitle = Fals
.Axes(xlValue, xlSecondary).HasTitle = Tru
.Axes(xlValue, xlSecondary).AxisTitle.Characters.Text = "perce
End Wit
==========================================
The above codes are taken from 2 parts of the recorded marcos
it seems that everytime i reach
.Axes(xlCategory, xlSecondary).HasTitle = Fals
.Axes(xlValue, xlSecondary).HasTitle = Tru
.Axes(xlValue, xlSecondary).AxisTitle.Characters.Text = "perce
an error will occur, saying [Method 'Axes' of object '_chart' failed], if i comment those "xlSecondary" lines out, the codes will run find again
May i know is there a solution for this?
I had tried using Marco Recorder to get the codes required for plotting a chart
It appears that the codes are given incorrectly, there are certain part of the codes have runtime error
===============================================
Charts.Ad
ActiveChart.ApplyCustomType ChartType:=xlBuiltIn, TypeName:=
"Line - Column on 2 Axes
==================================================
ActiveChart.Location Where:=xlLocationAsNewSheet, Name:="asdasd
With ActiveChar
.HasTitle = Tru
.ChartTitle.Characters.Text = "charttitle
.Axes(xlCategory, xlPrimary).HasTitle = Fals
.Axes(xlValue, xlPrimary).HasTitle = Tru
.Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "prod
.Axes(xlCategory, xlSecondary).HasTitle = Fals
.Axes(xlValue, xlSecondary).HasTitle = Tru
.Axes(xlValue, xlSecondary).AxisTitle.Characters.Text = "perce
End Wit
==========================================
The above codes are taken from 2 parts of the recorded marcos
it seems that everytime i reach
.Axes(xlCategory, xlSecondary).HasTitle = Fals
.Axes(xlValue, xlSecondary).HasTitle = Tru
.Axes(xlValue, xlSecondary).AxisTitle.Characters.Text = "perce
an error will occur, saying [Method 'Axes' of object '_chart' failed], if i comment those "xlSecondary" lines out, the codes will run find again
May i know is there a solution for this?