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.Ad dOLEObject 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
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.Ad
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
or these
http://www.freevbcode.com/ShowCode.Asp?ID=1729
http://www.freevbcode.com/ShowCode.Asp?ID=329
Good Luck
Andrew:)
http://www.freevbcode.com/ShowCode.Asp?ID=1729
http://www.freevbcode.com/ShowCode.Asp?ID=329
Good Luck
Andrew:)
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
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
ASKER
coz i'm using bookmarks in word to replace data so cant go with just excel.
kal
kal
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Oops.
For that example:
Change the following line ...
Dim oGraphChart As Graph.Chart
to this ...
Dim oGraphChart As Variant
Bye. -e2
For that example:
Change the following line ...
Dim oGraphChart As Graph.Chart
to this ...
Dim oGraphChart As Variant
Bye. -e2
ASKER
Ya d-man
thanx a million!!
kal
thanx a million!!
kal
http://www.freevbcode.com/ShowCode.ASP?SearchString=excel%20chart&ID=739
Regards
Andrew