Solved

Hey guys i need some help on excel chart

Posted on 2001-06-08
7
141 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
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 

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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

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…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…
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…

759 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now