Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

control Microsoft graph 8.0 with VBA

1 view
Skip to first unread message

yoni almog

unread,
Jun 14, 1998, 3:00:00 AM6/14/98
to

How do I control Microsoft graph 8.0 from within word 97 in visual basic for
applications?
For example how to control the datasheet, graph type.
Yal...@inter.net.il


johncla

unread,
Jun 15, 1998, 3:00:00 AM6/15/98
to

First, you need the complete helpfile, which is not installed by default.
Look for the Vbagrp8.hlp and Vbagrp8.cnt files in the ValuPack\MoreHelp
folder of your Office CD. Copy these complete files over the stub files
installed on your local drive.


Second, code you can use as a reference when automating Graph - the Sub
below automates Graph from PowerPoint. You can easily update it to work from
Word, instead. Be sure also to add a reference to the Graph object library
before you run this.

*******************

Sub InsertGraph()
Dim objGraph As Object
Dim shpGraph As PowerPoint.Shape
Dim objDatasheet As Object

With ActivePresentation.Slides(1)
Set shpGraph = _
.Shapes.AddOLEObject _
(classname:="msgraph.chart.8", link:=msoFalse)
End With

Set objGraph = shpGraph.OLEFormat.Object
Set objDatasheet = objGraph.Application.datasheet
objGraph.Application.Chart.ChartType = xlLine

End Sub


0 new messages