I'd like to integrate a graphic chart in a VBA form.
Is there an ActiveX control somewhere which
could help me doing this ? If yes, where can I
fint it ?
Thanx for you answers !
Greetings
Patrick Althaus
Thanx anyway !
First, in VBE, on a userform, add an image control. If the image
control is not available from the Toolbox toolbar, add it by right-
clicking the toolbar, selecting 'Additional Controls...' and finding the
image control. Then, at run time, use VBA to export the chart to an
image file (such as a jpg). Now, set the image controls picture
attribute to refer to the file just exported.
You can set the file name at design-time and then ensure that you export
the chart as the same file name.
This does *not* create a dynamic link in the sense that if the chart
changes while the userform is still displayed, the chart image within
the form will not update itself.
--
Regards,
Tushar Mehta
http://www.tushar-mehta.com
--
In <98i29r$fsn$3...@bw107zhb.bluewin.ch>, Patrick Althaus
<patrick...@also.ch> wrote
You can check out the automation help files on the Kb:
Q260410: Auto2000.exe
Q167223: Auto97.exe
Q186855: A97 Grphsm97.exe
"Microsoft Graph allows data to be charted. The functionality is similar to Microsoft Excel's Chart object but require less system resources to load. Since Microsoft Graph 97 is an applet, it must run inside a parent application such as Microsoft Access 97 or Microsoft Word 97. You cannot use Automation code to activate it externally with the CreateObject or GetObject functions. Rather, you must automate it through the container of the parent application, such as an OLE object control in a Microsoft Access form, or a Shape object control in a Microsoft Word document."
Steve
Patrick Althaus <patrick...@also.ch> wrote in message news:98i29r$fsn$3...@bw107zhb.bluewin.ch...
cheers
Phillip
"Patrick Althaus" <patrick...@also.ch> wrote in message
news:98i29r$fsn$3...@bw107zhb.bluewin.ch...
I finally used the MSChart ActiveX control.
(Tools - References - Microsoft Chart Control)
I didn't find it first and then installed VB 5.0.
After that I found it. (I'm still not sure if I really
searched for it very well the first time...)
Here's an example for the OCX :
Private Sub Command1_Click()
With Form1.MSChart1
' 3D diagram with 8 data columns
' and 8 data rows
.ChartType = VtChChartType3dBar
' draw the legend
.Location.Visible = True
.Location.LocationType = VtChLocationTypeRight
' set legend properties
.TextLayout.HorzAlignment = _
VtHorizontalAlignmentRight ' align right
' yellow text
.VtFont.VtColor.Set 255, 255, 0
.Backdrop.Fill.Style = VtFillStyleBrush
.Backdrop.Fill.Brush.Style = VtBrushStyleSolid
.Backdrop.Fill.Brush.FillColor.Set 255, 0, 255
.ColumnCount = 8
.RowCount = 8
' generate random data
For column = 1 To 8
For row = 1 To 8
.Column = column
.Row = row
.Data = row * 10
Next row
Next column
End With
End Sub
--
Regards,
Tushar Mehta
www.tushar-mehta.com
--
In <98n54j$1fc$1...@bw107zhb.bluewin.ch>, Patrick Althaus
<patrick...@also.ch> wrote
> Thank you for your answers !
>
> I finally used the MSChart ActiveX control.
> (Tools - References - Microsoft Chart Control)
> I didn't find it first and then installed VB 5.0.
> After that I found it. (I'm still not sure if I really
> searched for it very well the first time...)
>
> Here's an example for the OCX :
>
[snip]