LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Frankie
 
Posts: n/a
Default Issues copying excel charts to word documents - using Excel VBA

Hi,

I am trying to copy a chart from excel into a word document, at a
position specified by a bookmark. I also want the float over text to be
deactivated. My rather poor attempt at that was:

Sub FlushGraphs()

Dim WordObj As Word.Application, WordDoc As Word.Template

Set WordObj = CreateObject("Word.Application")

Sourcedir = ThisWorkbook.Path
FileName = Sourcedir & "\myworddocument.doc"
WordObj.Documents.Open (FileName)
WordObj.Visible = True

With Excel.Application
.ActiveSheet.ChartObjects("Chart 2").Activate
.ActiveChart.ChartArea.Select
.ActiveChart.ChartArea.Copy
End With



With WordObj

rRange = .ActiveDocument.Bookmarks(1).Range
rRange.PasteSpecial Link:=False,
DataType:=wdPasteEnhancedMetafile, _
Placement:=wdInLine, DisplayAsIcon:=False

.ActiveDocument.Bookmarks(2).Range.Text = "HELLO" ' to satisfy
myself the bookmarks work
End With


' Set WordDoc = Nothing
' Set WordObj = Nothing
' WordObj.Documents.Save
' WordObj.Documents.Close
' WordObj.Quit

End Sub

 
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
How to merge excel and word documents jacqueline Excel Discussion (Misc queries) 1 March 28th 06 01:52 AM
alignment problems when copying excel graphs to word petevang Excel Discussion (Misc queries) 2 November 23rd 05 09:57 PM
Copying an Excel chart into a Word document Carolyn Excel Discussion (Misc queries) 7 July 11th 05 07:29 PM
Excel startup switches Randy Excel Discussion (Misc queries) 9 June 14th 05 10:27 PM
Text not copying as text from Word to Excel 2003 Christine Excel Discussion (Misc queries) 4 March 3rd 05 11:33 PM


All times are GMT +1. The time now is 08:17 PM.

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"