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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with creating chart with VBA

Status
Not open for further replies.

MrSiezen

MIS
Sep 2, 2005
3
NL
Hi!

Trying all I can, googling all over the place, and my spamming my normal Access forum, I got a bit further in the seemingly pretty uncharted (hehe) world of editing a chart with VBA. I got stuck at changing the GroupingType of the axes. Found some MSDN-articles about this, but it didn't help.

Here's the code:
************
Private Sub CreateChart_Click()

Dim sChartspace As ChChart
Dim sCataxis As ChAxis
Dim sValAxis As ChAxis
Dim chConstants

Set chConstants = Me.subformChart.Form.ChartSpace.Constants
Set sChart = Me.subformChart.Form.ChartSpace.Charts(0)
Set sCataxis = Me.subformChart.Form.ChartSpace.Charts(0).Axes(chAxisPositionCategory)
Set sValAxis = Me.subformChart.Form.ChartSpace.Charts(0).Axes(chAxisPositionValue)

sCataxis.Title.Caption = "Categorie"
sCataxis.GroupingType = chAxisGroupingManual
sCataxis.GroupingUnitType = chAxisUnitWeek
sCataxis.GroupingUnit = 1

************
The last three lines generate errors.

Here's the error message:

Run-time error '-2147467259 (80004005)':

Invalid Parameter

Can someone help me with fixing this?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top