A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Excel Chart Programming



 
 
Thread Tools Display Modes
  #1  
Old July 5th, 2009, 06:50 AM posted to microsoft.public.excel.newusers
rtw120
external usenet poster
 
Posts: 1
Default 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.
  #2  
Old July 5th, 2009, 07:36 AM posted to microsoft.public.excel.newusers
Shane Devenshire[_3_]
external usenet poster
 
Posts: 3,333
Default 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.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 03:11 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.