ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   New Users to Excel (https://www.excelbanter.com/new-users-excel/)
-   -   Excel Chart Programming (https://www.excelbanter.com/new-users-excel/235857-excel-chart-programming.html)

rtw120

Excel Chart Programming
 
Can anyone help with following statement error, I had tried VS8, S9, and VS10
all the same.

' YAxis
Dim axisY As Excel.Axis
axisY = xlChart.Axes(Excel.XlAxisType.xlValue, Excel.XlAxisGroup.xlPrimary)
axisY.HasTitle = False
axisY.HasMajorGridlines = True
axisY.HasMinorGridlines = False

axisY.MajorTickMark =
Microsoft.Office.Interop.Excel.XlTickMark.xlTickMa rkInside
axisY.MinorTickMark = Microsoft.Office.Interop.Excel.XlTickMark.xlTickMa rkNone
axisY.TickLabelPosition =
Microsoft.Office.Interop.Excel.XlTickLabelPosition .xlTickLabelPositionNextToAxis
axisY.Border.Weight = Excel.XlBorderWeight.xlHairline
axisY.Border.LineStyle = Excel.XlLineStyle.xlLineStyleNone
axisY.CrossesAt = 1
axisY.TickLabelSpacing = 1
axisY.TickMarkSpacing = 1
axisY.AxisBetweenCategories = True
axisY.ReversePlotOrder = False

' Series
Dim series1 As Excel.Series = xlChart.SeriesCollection(1)
Dim xlChartGroups As Excel.ChartGroups = xlChart.ChartGroups()
Dim xlChartGroup As Excel.ChartGroup = xlChartGroups.Item(1)
xlChartGroup.Overlap = 100
xlChartGroup.GapWidth = 0
xlChartGroup.HasSeriesLines = False
xlChartGroup.SeriesLines.Border.LineStyle = Excel.XlLineStyle.xlLineStyleNone
xlChartGroup.SeriesLines.Border.Weight = Excel.XlBorderWeight.xlThin
series1.Shadow = False
series1.InvertIfNegative = False
series1.Format.Fill.TwoColorGradient
(Microsoft.Office.Core.MsoGradientStyle.msoGradien tVertical, 2)
series1.Format.Fill.Visible = Microsoft.Office.Core.MsoTriState.msoTrue
series1.Format.Fill.ForeColor.SchemeColor = 3
series1.Format.Fill.BackColor.SchemeColor = 2

The issue is when I run it and error is I can not setup property in above
some statement, there are some get same error.

Thanks.

Shane Devenshire[_2_]

Excel Chart Programming
 
Hi,

This question is not complete:

What lines of code are causing the errors and what is the exact error message?

What is "VS8, S9, and VS10"?

--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire


"rtw120" wrote:

Can anyone help with following statement error, I had tried VS8, S9, and VS10
all the same.

' YAxis
Dim axisY As Excel.Axis
axisY = xlChart.Axes(Excel.XlAxisType.xlValue, Excel.XlAxisGroup.xlPrimary)
axisY.HasTitle = False
axisY.HasMajorGridlines = True
axisY.HasMinorGridlines = False

axisY.MajorTickMark =
Microsoft.Office.Interop.Excel.XlTickMark.xlTickMa rkInside
axisY.MinorTickMark = Microsoft.Office.Interop.Excel.XlTickMark.xlTickMa rkNone
axisY.TickLabelPosition =
Microsoft.Office.Interop.Excel.XlTickLabelPosition .xlTickLabelPositionNextToAxis
axisY.Border.Weight = Excel.XlBorderWeight.xlHairline
axisY.Border.LineStyle = Excel.XlLineStyle.xlLineStyleNone
axisY.CrossesAt = 1
axisY.TickLabelSpacing = 1
axisY.TickMarkSpacing = 1
axisY.AxisBetweenCategories = True
axisY.ReversePlotOrder = False

' Series
Dim series1 As Excel.Series = xlChart.SeriesCollection(1)
Dim xlChartGroups As Excel.ChartGroups = xlChart.ChartGroups()
Dim xlChartGroup As Excel.ChartGroup = xlChartGroups.Item(1)
xlChartGroup.Overlap = 100
xlChartGroup.GapWidth = 0
xlChartGroup.HasSeriesLines = False
xlChartGroup.SeriesLines.Border.LineStyle = Excel.XlLineStyle.xlLineStyleNone
xlChartGroup.SeriesLines.Border.Weight = Excel.XlBorderWeight.xlThin
series1.Shadow = False
series1.InvertIfNegative = False
series1.Format.Fill.TwoColorGradient
(Microsoft.Office.Core.MsoGradientStyle.msoGradien tVertical, 2)
series1.Format.Fill.Visible = Microsoft.Office.Core.MsoTriState.msoTrue
series1.Format.Fill.ForeColor.SchemeColor = 3
series1.Format.Fill.BackColor.SchemeColor = 2

The issue is when I run it and error is I can not setup property in above
some statement, there are some get same error.

Thanks.



All times are GMT +1. The time now is 08:09 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com