Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 225
Default Word Document that shows Excel Chart

Hi

Here is a sample code.
[Here the book2.xls located on c: have a chart on sheet1]

Private Sub Command2_Click()
Dim wd As Word.Application
Dim exapp As Excel.Application
Set wd = New Word.Application
Set exapp = New Excel.Application
exapp.Workbooks.Open "c:\book2.xls"
exapp.Worksheets("Sheet1").ChartObjects(1).Chart.C hartArea.Copy
wd.Visible = True
wd.Documents.Add.Content.PasteSpecial link:=True, DataType:=0
End Sub

Please have a try and let me if this does the job for you.
Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
From: "hmmm..."
Newsgroups:

microsoft.public.word.oleinterop,microsoft.public. word.vba.general,microsoft
public.word.word97vba,microsoft.public.excel.chart ing,microsoft.public.exce
l.misc,microsoft.public.excel.programming
Subject: Word Document that shows Excel Chart
Lines: 8
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4807.1700
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
Message-ID: et
Date: Wed, 20 Aug 2003 17:21:52 GMT
NNTP-Posting-Host: 209.178.190.87
X-Complaints-To:
X-Trace: newsread4.news.pas.earthlink.net 1061400112 209.178.190.87 (Wed,

20 Aug 2003 10:21:52 PDT)
NNTP-Posting-Date: Wed, 20 Aug 2003 10:21:52 PDT
Organization: EarthLink Inc. --
http://www.EarthLink.net
Path:

cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed 00.sul.t-online.de!t-onlin
e.de!newsfeed.freenet.de!newsfeed.news2me.com!elnk-nf2-pas!newsfeed.earthlin
k.net!stamper.news.pas.earthlink.net!newsread4.new s.pas.earthlink.net.POSTED
!not-for-mail
Xref: cpmsftngxa06.phx.gbl microsoft.public.word.vba.general:41111

microsoft.public.word.word97vba:68352 microsoft.public.excel.charting:32887
microsoft.public.excel.misc:266349
microsoft.public.excel.programming:408492
microsoft.public.word.oleinterop:8588
X-Tomcat-NG: microsoft.public.excel.programming

I would like to launch an Excel workbook from a Word document. The

workbook
updates a chart when the workbook is started. The chart must be displayed
in the Word document.Can anyone point me in the right direction, or show me
an example piece of code?

Thanks.







Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
excel 2007 chart in word document kdilly Excel Discussion (Misc queries) 0 February 2nd 10 08:34 PM
How to insert a word document onto an Excel Chart rb22 Excel Discussion (Misc queries) 1 June 16th 09 06:04 PM
EXCEL chart into Word document Perplexed Excel Discussion (Misc queries) 0 December 9th 07 09:51 PM
Copying excel chart to word document without gridlines Rudy Charts and Charting in Excel 1 May 31st 07 04:07 AM
Copying an Excel chart into a Word document Carolyn Excel Discussion (Misc queries) 7 July 11th 05 07:29 PM


All times are GMT +1. The time now is 02:54 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"