Solved

Hey guys i need some help on excel chart

Posted on 2001-06-08
7
147 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
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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

Title # Comments Views Activity
Copy a row 12 75
fso.FolderExists("\\server\HiddenFolder$") 4 96
vbModal 12 73
VB6 Enviroment 3 33
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
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…

739 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