Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 52
Default Exporting to Word

You could find the address of the bottom right cell of the chart, then
copy and paste a picture of the range. For example:

Dim strCell As String
strCell = ActiveSheet.ChartObjects("Chart 138").BottomRightCell.Address
..
..
With ActiveSheet
Range(Range("A9"), Range(strCell)).CopyPicture _
Appearance:=xlScreen, Format:=xlBitmap


Michael wrote:
Hi Guys,


I have a macro that copies a range in excel and exports it
to word. My problem is won't copy the linked chart when I
select the used range. How do I write a routine that will
copy both the range and chart and insert them both into
word. Also I have found that it will also not paste
special as a bitmap, only as an excel worksheet.

I attach code below which I have edited from a previously
answer post in this newsgroup

Thanks for your help

Michael

Private Sub CommandButton2_Click()
Worksheets("calculations").Select
Application.CutCopyMode = xlCopy
Application.DisplayAlerts = False
On Error Resume Next
Dim rng As Range
With ActiveSheet
Range(Range("A9"), ActiveCell.SpecialCells
(xlLastCell)).Copy
.ChartObjects("Chart 138").Activate
.ChartArea.Select
.ChartArea.Copy
Dim APPWD As Object
Dim i As Integer
Set APPWD = CreateObject("Word.Application")
APPWD.Visible = True
APPWD.ChangeFileOpenDirectory ActiveWorkbook.path
APPWD.Documents.Open Filename:="NewCashflow.doc",
ConfirmConversions:=False, ReadOnly:=True
APPWD.Selection.PasteSpecial Link:=False,
DataType:=wdPasteBitmap, _

Placement:=wdFloatOverText, DisplayAsIcon:=False
Application.DisplayAlerts = True

End With
End Sub



--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html

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
Exporting graphs to Word kippers Excel Discussion (Misc queries) 3 April 9th 09 01:34 PM
Exporting information to a word doc Exporting information to a word doc Excel Discussion (Misc queries) 1 January 14th 09 04:03 PM
Exporting to Word in a csv file Brad Excel Discussion (Misc queries) 5 August 20th 05 06:53 PM
exporting excel worksheet to word morrowkd Links and Linking in Excel 1 May 5th 05 01:05 PM
exporting single cells to Word Anja B Excel Discussion (Misc queries) 3 February 2nd 05 08:47 PM


All times are GMT +1. The time now is 02:06 PM.

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

About Us

"It's about Microsoft Excel"