Dys060801
asked on
Excel Chart in VB6
I would like to be able to display an Excel chart on a VB6 form. Could someone please point me in the right direct as to how to code the connection. L'd prefer to learn how to code it rather than using a bound control. Thanks in advance,
Dys
Dys
ASKER
Hi hongjun,
Thanks for your response. It gave me a little bit of help in understanding the relationship between Excel and VB. However, it didn't give me help in the specific area I'm interested in. Let me explain.
I am developing a VB application connected to an MS Access database. A SQL query in my application will return a group of numbers to my application in the form of a recordset (which I could convert to an array).
I would like to send those numbers in the recordset to an Excel spreadsheet, have Excel produce a Pie Chart and then have the Pie Chart returned to my application and displayed on a Form in my application.
I am assuming that returning and displaying a Pie Chart (probably an object) is different than returning a spreadsheet depositing the data into an ADO Recordset.
Hope this clarifies the problem I have.
Thanks,
Dys
Thanks for your response. It gave me a little bit of help in understanding the relationship between Excel and VB. However, it didn't give me help in the specific area I'm interested in. Let me explain.
I am developing a VB application connected to an MS Access database. A SQL query in my application will return a group of numbers to my application in the form of a recordset (which I could convert to an array).
I would like to send those numbers in the recordset to an Excel spreadsheet, have Excel produce a Pie Chart and then have the Pie Chart returned to my application and displayed on a Form in my application.
I am assuming that returning and displaying a Pie Chart (probably an object) is different than returning a spreadsheet depositing the data into an ADO Recordset.
Hope this clarifies the problem I have.
Thanks,
Dys
Why not embed an OLE object in your form and make it an excel object. Then you channel the data into that, run the graph and display the result when its ready?
I've done that with word objects. There are controls you can add to the form, I think you want OLE/COM object and check the properties.
I'm away from work, otherwise I'd check out exactly what to do...
I've done that with word objects. There are controls you can add to the form, I think you want OLE/COM object and check the properties.
I'm away from work, otherwise I'd check out exactly what to do...
ASKER
Thanks for the response Sorklin. Its seems to be getting closer to the solution I need. However, I'd appreciate some direction on the object insertion and coding involved when you are back at work. Haven't played around much with OLE/COM objects. I'm not in a hurry on this one, I can wait...
Dys :)
Dys :)
I'm working on this, so give me a bit of time...
ASKER
No problem I'll wait.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks very much Sorklin. I'm cellphone communicating right now, but when I get back to my notebook later today I'll give it a try.
ASKER
Thanks Sorklin. It took me a while to get back to this problem, but after applying your solution with a few minor adjustments it worked fine. Many thanks!
http://www.vbdiamond.com/Sources/ViewSource.asp?File=1&ID=16431
hongjun