473,421 Members | 1,715 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,421 software developers and data experts.

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

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
5 6321
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
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

<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
Hi Randy,

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

Brooks

Nov 24 '05 #5
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: Allison Bailey | last post by:
Hi Folks, I'm a brand new Python programmer, so please point me in the right direction if this is not the best forum for this question.... I would like to open an existing MS Excel spreadsheet...
0
by: TC | last post by:
Hello, Here is what I'm trying to do: -- Make sure both MS Excel and MS Word are running -- Create an Excel chart -- Save the Excel file -- Copy the Excel chart onto the clipboard using Ctrl...
5
by: TC | last post by:
Hello, Here is what I'm trying to do: -- Make sure both MS Excel and MS Word are running -- Create an Excel chart -- Save the Excel file -- Copy the Excel chart onto the clipboard using Ctrl...
1
by: Megan | last post by:
Hi- I was wondering if it is possible to code a macro to: 1. retrieve a bunch or records 2. output them to an excel file 3. have excel start up 4. process the data received from access 5....
1
by: digitalego | last post by:
Sorry if the title is a little confusing... Here is the problem. I am working with a "default.aspx" page that uses a user control I made: ------------------------------ | default.aspx ...
3
by: hayuti | last post by:
Hi there This Question was posted on a wrong site. Just as introduction I am working in Access VBA where I coded a routine to retrive data from Access Database, exporting it on to Excel file...
0
by: AlexNunley | last post by:
I am trying to dump data from an access query into excel so I can pretify it. I found sample code from an old access 97 book (The version of access in use)and tinkered it into working. Well sort...
3
by: dorlesky | last post by:
I've tried numerous times to get Excel to recognise the Excel Chart Object inserted into an Access Report. No Luck. I can get Access to start an instance of Excel, I can get Access to send the...
1
by: il0postino | last post by:
Apologies in advance for this newbie question! I have an Access form with an unbound embedded Excel chart on it(Called, OLEUnbound39) (Done on Access form by Insert > Object > Microsoft excel...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.