Solved

Hey guys i need some help on excel chart

Posted on 2001-06-08
7
146 Views
Last Modified: 2010-05-02
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
0
Comment
Question by:kaldude
  • 3
  • 2
  • 2
7 Comments
 
LVL 5

Expert Comment

by:AndrewDev
ID: 6168322
0
 
LVL 5

Expert Comment

by:AndrewDev
ID: 6168337
0
 

Author Comment

by:kaldude
ID: 6168348
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
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:kaldude
ID: 6168357
coz i'm using bookmarks in word to replace data so cant go with just excel.


kal
0
 
LVL 7

Accepted Solution

by:
q2eddie earned 50 total points
ID: 6169345
Hi, kaldude.

#Links
1. "HOWTO: Automate An Embedded MSGraph Object with Visual Basic"
http://support.microsoft.com/support/kb/articles/Q244/5/89.asp

Bye. -e2
0
 
LVL 7

Expert Comment

by:q2eddie
ID: 6169364
Oops.

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

to this ...
Dim oGraphChart As Variant

Bye. -e2
0
 

Author Comment

by:kaldude
ID: 6169375
Ya d-man

thanx a million!!


kal
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question