Link to home
Start Free TrialLog in
Avatar of kaldude
kaldude

asked on

Hey guys i need some help on excel chart

hello all

The code below just creates a doc file which puts a excel chart on the doc file but the probelm is how do i change the chart type and give data for the chart to plot


Dim letters As New Word.Application
Dim letterdoc As New Word.Document
Set letterdoc = letters.Documents.Add
With letters
    .Selection.TypeText "Total closed tickets by priority"
   
    .Selection.InlineShapes.AddOLEObject ClassType:="excel.chart.8"
   
   
    End With

letterdoc.SaveAs "c:\kalpesh1.doc"
letterdoc.Close
Set letterdoc = Nothing
letters.Quit
Set letters = Nothing


this is what i wanna do but how do i do it???


i tried to use record the macro but somehow it wont work

plz help me!!

kal
Avatar of AndrewDev
AndrewDev

Avatar of kaldude

ASKER

Hey man

thanx a bunch for that prompt reply

dude i know how to make excel component work but dude my problem is little diff from what we have in that prog

i want to put an excel chart on the word doc as ya can do it from word and then change the data and all that, so i wanna do same thing from vb make a doc file fill in all the data and then create a excel chart with some other data!!

thanx dude
Avatar of kaldude

ASKER

coz i'm using bookmarks in word to replace data so cant go with just excel.


kal
ASKER CERTIFIED SOLUTION
Avatar of q2eddie
q2eddie
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Oops.

For that example:
Change the following line ...
Dim oGraphChart As Graph.Chart

to this ...
Dim oGraphChart As Variant

Bye. -e2
Avatar of kaldude

ASKER

Ya d-man

thanx a million!!


kal