MSGraph.Chart.8: How many object models?

P

(PeteCresswell)

I'm going nuts trying to instantiate a chart and change it's
props.

Access 2003.

I downloaded the example at
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q186855
but the object model seems tb entirely different from 2003's.

I'm trying to follow the example in this 2003-specific sample
http://msaccesstips.com/2008/06/working-with-chart-object-in-vba/

but when I get down to an Immediate window, I'm getting too many
"Run-time error '438': Object doesn't support this property or
method."

The first one I can see.... Access 97 vs 2003.

But on the second one, I'd like to hear that there is only one
object model out there and this is RCI on my part.
 
R

Rob Parker

Hi Pete,

I'm not sure exactly what you're trying to do, or exactly what your problem
is. I'm also not aware of any differences in the graph object model that's
available in A97 (though it's a long time since I used that) and A2003 (my
usual version).

Are you trying to work through the example from the msaccesstips site you
listed, in the Grphsm97.mdb database from the first site?

I've downloaded both sample databases, and both work fine (in A2003). The
Grphsm97.mdb works when it is opened as an A97 file, but if I do that I'm
unable to make any changes - I can't even add a new Table1 (following the
workthrough on the msaccesstips site), unless I convert the file to A2002-03
format.

Converting the Grphsm97.mdb to A2002-03 file format and then working through
the msaccesstips site example gives the following problems:
1. The cut/pasted code for Function ChartObject(...) initially does not
compile. There are 2 problems:
a. the line which starts "msg = ..." should in fact be 4 lines,
separating each one after cr in the (undefined) variable "crmsg"
b. there is no End If for the "If ctype = 3 Then" statement. I added
this immediately after the "Goto nextstep" line

Once the code compiles after fixing these two problems, the rest of the
workthrough runs OK. I'm unable, therefore, to assist further, without some
more information as to what exactly you are doing, and where exactly it's
failing.

Rob
 
P

(PeteCresswell)

Per Rob Parker:
Once the code compiles after fixing these two problems, the rest of the
workthrough runs OK. I'm unable, therefore, to assist further, without some
more information as to what exactly you are doing, and where exactly it's
failing.

Thanks for all the effort.

I am unable to get to most of the object's properties.

But you are - so you've confirmed what I had hoped for: it's RCI
on my part...... and I can fix that.... eventually.....

Basically what I am trying to do is get VBA access to the chart's
properties. Seems like that will let me fix little things -
like a pie chart's labels stepping on each other - that can't be
changed via the UI props dialog.
 
D

David W. Fenton

But you are - so you've confirmed what I had hoped for: it's RCI
on my part...... and I can fix that.... eventually.....

Sounds like you need to decompile.
 
R

Rob Parker

Hi Pete,

I've done some more playing, and have been unable to generate RTE 438. I
thought that maybe I'd get this if I called the function with incorrect
names for either the report or the chart object, but those give different
errors.

With the code running in debug mode, after the "grphChart.Activate" code
statement has executed, when code execution is paused I can enter statements
such as
grphChart.Size = 11000
to change the chart object's size, or
grphchart.charttype = xl3dcolumnclustered
to change the chart type.

I can generate RTE 1004 ("Unable to set ...") by doing something like
grphchart.hastitle = false
grphchart.charttitle.text = "Test"
where I try to set something for a property which I've just removed, but
even like this I haven't got RTE 438.

Has David Fenton's decompile suggestion fixed things?

Again, HTH,

Rob
 
P

(PeteCresswell)

Per Rob Parker:
Has David Fenton's decompile suggestion fixed things?

No. And I decompile on at least a daily basis - sometimes more
often.

But it sounds to me like I'm just doing some little thing wrong
and as soon as I find it I'll be in business.

Right now I'm scrambling to get all the essential stuff - like
numbers - right. I'll get back to the cosmetics as soon as
they sign off on the essentials.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top