Serving the Quantitative Finance Community

 
User avatar
Domingues
Topic Author
Posts: 0
Joined: November 27th, 2002, 12:25 pm

Graph in UserForm

November 27th, 2002, 12:34 pm

Please, how could I display a graph in a UserForm?
 
User avatar
Domingues
Topic Author
Posts: 0
Joined: November 27th, 2002, 12:25 pm

Graph in UserForm

November 27th, 2002, 12:38 pm

Ops... I'm talking about VBA... sorry.
 
User avatar
PinballWizard
Posts: 4
Joined: March 13th, 2002, 4:36 pm

Graph in UserForm

November 27th, 2002, 8:50 pm

Domingues,I assume you are trying to place an Excel chart onto a VBA UserForm (?).Unfortunately it cannot be done directly. The easiest way would be to convert the Excel chart to a bitmap and then to assign the bitmap to the .Picture property of the form itself (i.e. as a background bitmap) or the .Picture property of an Image control.Of course an alternative is to plot your chart programmatically. You would have to do this by making calls to the Win32 (GDI) API, as none of the built-in VBA controls have the VB drawing methods (Pset() etc. )Using a 3rd party charting control (e.g. ChartFX, Dundas Chart) is another option if you have access to one.Let me know if you need more help.P.
 
User avatar
PinballWizard
Posts: 4
Joined: March 13th, 2002, 4:36 pm

Graph in UserForm

November 28th, 2002, 1:13 am

..I missed a couple of options:- you can use an Excel spreadsheet ActiveX control (comes with VB6 I believe) or an Office Web component control. These alternatives are not great though as these controls are quite big and clunky.BTW Domingues, nice website you have, and cool calculator you built I have seen a similar calculator built using Flash - it looks just like the real thing.
 
User avatar
Domingues
Topic Author
Posts: 0
Joined: November 27th, 2002, 12:25 pm

Graph in UserForm

November 28th, 2002, 11:50 am

Thank you!!! I'll use the easiest way. I think my website needs a English version.