By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,442 Members | 1,302 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,442 IT Pros & Developers. It's quick & easy.

How to control an Excel.Chart.8 object in an Access form?

P: n/a
I have an unbound OLE object on a form:

Name: OLEExcelChart
OLE Class: Microsoft Excel 2000
Class: Excel.Chart.8

I need to manipulate properties of the chart as well as the underlying
data.

I tried changing the chart type with:

Dim xlChart As Object

Set xlChart = Me.OLEExcelChart

xlChart.PlotArea.Select
xlChart.ChartType = xl3DPie

and get runtime error 438 "Object doesn't support this property or
method".

Would appreciate any help or code snippets.

Thanks,

Brooks

Nov 24 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
There is another layer of layering you need to unwrap.
Set xlChart = Me.OLEExcelChart.object

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
<br****@rimesrv.net> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...
I have an unbound OLE object on a form:

Name: OLEExcelChart
OLE Class: Microsoft Excel 2000
Class: Excel.Chart.8

I need to manipulate properties of the chart as well as the underlying
data.

I tried changing the chart type with:

Dim xlChart As Object

Set xlChart = Me.OLEExcelChart

xlChart.PlotArea.Select
xlChart.ChartType = xl3DPie

and get runtime error 438 "Object doesn't support this property or
method".

Would appreciate any help or code snippets.

Thanks,

Brooks

Nov 24 '05 #2

P: n/a
Thanks for the post, Stephen. I changed as below but got the same
error ...

Brooks

Dim xlChart As Object

Set xlChart = Me.OLEExcelChart.Object

xlChart.PlotArea.Select
xlChart.ChartType = xl3DPie

Nov 24 '05 #3

P: n/a

<br****@rimesrv.net> wrote in message
news:11**********************@g49g2000cwa.googlegr oups.com...
Thanks for the post, Stephen. I changed as below but got the same
error ...

Brooks

Dim xlChart As Object

Set xlChart = Me.OLEExcelChart.Object

xlChart.PlotArea.Select
xlChart.ChartType = xl3DPie


Brooks, I don't know what the problem is (Stephen knows this stuff much
better than me), but that error message is often associated with a missing
reference. Any chance you might need to set a reference to the Excel
library?

Randy

Nov 24 '05 #4

P: n/a
Hi Randy,

Good thought, but I checked and DO have a reference set to the Excel
Object Library.

Brooks

Nov 24 '05 #5

P: n/a
Well, now I probably know less than either of the other two respondents, but
I managed to create an unbound object frame on a form, with the properties
the OP showed.
I then added a button, with this code:
msgbox OLEExcelChart.Object.Name

The name it showed me was Book3, so I figured I needed to dig deeper.
This code changed the display to a pie:

with OLEExcelChart.Object.Charts(1)
.ChartType = xl3DPie
end with

Note: The Charts collection appears to be 1-based, as Charts(0) returned an
error.
Also: I was not able to select the PlotArea.

HTH
<br****@rimesrv.net> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...
I have an unbound OLE object on a form:

Name: OLEExcelChart
OLE Class: Microsoft Excel 2000
Class: Excel.Chart.8

I need to manipulate properties of the chart as well as the underlying
data.

I tried changing the chart type with:

Dim xlChart As Object

Set xlChart = Me.OLEExcelChart

xlChart.PlotArea.Select
xlChart.ChartType = xl3DPie

and get runtime error 438 "Object doesn't support this property or
method".

Would appreciate any help or code snippets.

Thanks,

Brooks

Nov 25 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.