views:

1728

answers:

2

Hi,

I have to display a column chart in a user form in VBA. Exporting the chart to GIF and importing in a picture box works; but I cannot use it because the chart needs to be modified based on options chosen by the user from the same form. I have been searching and people have commented that default OLE/OCX controls provided by MS may be used. I cannot find an ActiveX which may do the trick. Does somebody know which controls to use and how to use them?

A: 

You might want to try this if you just need 2D graphing:

2D Graph Control

3D Graph Control

Jon Fournier
Thanks Jon :) but I wanted the column charts on my form. This ActiveX control only allows line graphs. Do you know of something which can plot column graphs?
Kshitij
+2  A: 

Just use Microsoft Chart, it's the same engine as Microsoft Excel.

Assuming you're using Excel 2003 ... the control is called "Microsoft Office Chart 11.0"

If you have Excel 2007, Microsoft did not ship the chart control. But you can still download Microsoft Office Chart 11.0. It's in a file called OWC11.EXE.

Then, in the VBA editor, when your VBA UserForm is showing, right click on the toolbox and choose "Additional Controls" and then check "Microsoft Office Chart 11.0" from the list that appears.

Joel Spolsky
Thanks Joel for the reply :) Somehow, the list of controls I see on clicking "Additional Controls" does not contain "Microsoft Office Chart 11.0". Do I need to import some file to see the control?
Kshitij
Hmm, maybe that's because I also have Office 2003 installed on this machine :/
Joel Spolsky
Looks like you can still download it from Microsoft. I edited my answer to reflect this.
Joel Spolsky
Thanks Joel :) Finally I got the PMs permission to install OWC. I can see the Charts control now.
Kshitij