Code works in Excel but not in Access

  • Thread starter Thread starter Mike Collard
  • Start date Start date
M

Mike Collard

I have an Excel macro that formats a chart and I have
tried adapting it for Access.

The following line is executed OK in Excel :

Select Case ActiveChart.SeriesCollection(Counter).Name

I have changed it to the following for Access

Select Case Me!
DERVGraph.Object.Application.Chart.SeriesCollection
(Counter).Name

but in Access I get an error 'Object does not support this
property or method.



Any ideas?

Thanks
 
I believe that Chart is actually a property, not an object.

I think you need something like

Select Case Me!
DERVGraph.Object.Application.Charts(1).SeriesCollection
(Counter).Name

This assumes you only have 1 chart: you'll have to play with the number in
other cases.
 
Doug

Thanks, will give it a try

Mike
-----Original Message-----
I believe that Chart is actually a property, not an object.

I think you need something like

Select Case Me!
DERVGraph.Object.Application.Charts(1).SeriesCollection
(Counter).Name

This assumes you only have 1 chart: you'll have to play with the number in
other cases.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)






.
 
I am not sure about your reference. In one of my database, I use:

Set objChart = Me.oleGraph.Object

to refer to the Chart Object ("oleGraph' is the name of the Unbound Object
Frame of OLE Class "Microsoft Graph Chart") and it works fine. Thus, in
your code, I would simply use:

Me!DERVGraph.Object.SeriesCollection(Counter).Name
 
Van

Thanks will give it a go

Mike
-----Original Message-----
I am not sure about your reference. In one of my database, I use:

Set objChart = Me.oleGraph.Object

to refer to the Chart Object ("oleGraph' is the name of the Unbound Object
Frame of OLE Class "Microsoft Graph Chart") and it works fine. Thus, in
your code, I would simply use:

Me!DERVGraph.Object.SeriesCollection(Counter).Name

--
HTH
Van T. Dinh
MVP (Access)







.
 
Back
Top