?
Solved

Hey guys i need some help on excel chart

Posted on 2001-06-08
7
Medium Priority
?
153 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Independent Software Vendors: 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 150 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

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…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month14 days, 16 hours left to enroll

771 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