MS Chart

G

Goh

Hi,

I think Microsoft did have a good documentation on office web
components. I use more than 2 days trying to resolve this problem already. I
hope you guy can share with me how to solve the problem.

I'm automate insert chart to power point using VBA. I able to insert
chart and using fileimport method to plum in raw data. I think to
programmatically insert raw data into the chart. But I fail many many time.
no matter what method that I use. it still fail without giving me a proper
error message.

I think in order to insert data should call chart.application.datasheet
but it cannot let me initial to a variable.

Any samples with source can show me how can done this? I have saw a few
articles in internet with some snapshoot source code, but all is fail in my
testing.


I also encounter that Graph able to set the raw data by xml file. How
actually this can be done. I saw this in some infopath articles.

With regards,
Goh
 
P

Peter Huang [MSFT]

Hi Goh,

Thanks for your posting!
Based on my understanding, you are going to use Microsoft Graph object.
In PPT, we will insert the Graph by clicking Menu, Insert/Chart. And you
can do them programmatically insert the graph.
But now you want to call the FileImport method, but failed.

Currently I will focus on this issue with you.
You may try the code below.(I assume an new PPT is created and only the
graph is inserted in the first slide.
Sub Macro1()
Dim myChart As Graph.Chart
Set myChart =
Application.ActivePresentation.Slides(1).Shapes(1).OLEFormat.Object
With myChart.Application
.FileImport FileName:="c:\tset.xls", _
ImportRange:="A1:E4", WorksheetName:="Sheet1", _
OverwriteCells:=True
End With
End Sub

From the VBA helper, it seems that the FileImport accepted an xls file.

For xml file issue, can you show the links to the articles you means?

Thanks.

Best regards,

Peter Huang

Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
G

Goh

Hi,
Thanks for reply.
It work perfectly in.
Now another issue come I can't plug in this MS Chart into InfoPath
documents. Do you guy know how to add MS Chart in InfoPath? I think the way
is different with what I ask last time.


With regards,
Goh
 
P

Peter Huang [MSFT]

Hi Goh,

I understand you want to insert the MS CHART into InfoPath 2003 Form.

Based on my research, there is no such an option to insert OLE Object(MS
Chart is an OLE Object) into InfoPath.

AFAIK, InfoPath is a electronic Form which works based on XML data. When we
send a form, we just send the inform we input in the form onto the the
receiver, but for the OLE Object it is hard to do that.
But it is hard to do that, OLE Object can not developped by other
developer, the data format is not standard.

BTW: Common we focus on one question in one thread, if you have more than
one question, I think you may try to post in new thread.

Best regards,

Peter Huang

Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 

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