ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Graph in form (https://www.excelbanter.com/excel-programming/328745-graph-form.html)

OMAR

Graph in form
 
Hi,

I'd like to know if it's possible to add (I mean, to calculate and show) an
Excel graph in a VBA form. I wouldn't like to import the graph as an image.

I've searched some class information in the VBA editor, but I haven't found
any.

Could you point me in the right direction?

TIA.

Robin Hammond[_2_]

Graph in form
 
Omar,

Not as far as I know directly. The usual approach is to paste a picture of
the graph onto the form by exporting the graph from a sheet or chart sheet
as an image then loading the image from disk to a picture box. There's a
faster alternative using Stephen Bullen's PastePicture routine which avoids
having to save to disk but it is quite a complex piece of code. The chart
browser in my XspandXL add-in on my site uses the latter for speed reasons.

I have not done this before, but if you really really want to achieve this,
you could try to embed an Office Web Component Chart Control on the form.
You'll need it installed and so would all your target machines, of course,
then you'll have to figure out the object model. I've just tried it to see
how it looks and it is possible to get it on the form. In the VBE, open the
toolbox, right click and select Additional Controls, then look for Microsoft
Office Chart n.nn to find the control, then draw it on your form. From
there, you are on your own as far as figuring it out I'm afraid. In the few
minutes I have I haven't tried to set it up to hook to Excel directly for
its data.

Robin Hammond
www.enhanceddatasystems.com


"Omar" wrote in message
...
Hi,

I'd like to know if it's possible to add (I mean, to calculate and show)
an
Excel graph in a VBA form. I wouldn't like to import the graph as an
image.

I've searched some class information in the VBA editor, but I haven't
found
any.

Could you point me in the right direction?

TIA.




OMAR

Graph in form
 
Hi Paul,

I appreciate your time and help. The e-mail address is:


Regards,

Omar RodrĂ*guez.

"Paul Martin" wrote:

Hi Omar

I recently found a solution to this by Mike Powell on
microsoft.public.vb.syntax at
<http://groups.google.com.au/groups?hl=en&lr=&newwindow=1&safe=off&selm=utLzb.7 33%24XF6.18632%40typhoon.sonic.net

His code is a little crude but effective, and if you send me your email
address (I cannot see it from Google Groups, where I'm viewing this), I
will send you a file that demonstrates this working simply.

Regards

Paul Martin
Melbourne, Australia



Paul Martin

Graph in form
 
Hi Omar

I view newsgroups through Google Groups, which masks email addresses.
Please send to me direct at pmartin1960 AT hotmail DOT com

Regards

Paul



All times are GMT +1. The time now is 12:14 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com