Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 93
Default Programming pasting charts to work problem

I am atomating report production using Excel and word. The basic operation is
ok I use bookmarks in word to position tables an charts pasted from Excel.
My problem is that the report designers have specified round corners to the
chart borders. This is no problem to set up in Excel and manually pasting the
chart to Word works fine. However doing it by programming turns the round
corners to square ones! Why?
I use the code below to paste the charts - My thanks for any suggestions

With rbmReport
..Select
xlWSheet.ChartObjects(cArray(iLoop)).Copy
.PasteSpecial _
Link:=False, _
Placement:=wdInLine, _
DataType:=wdPasteEnhancedMetafile
End With


--
Dean Mann
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 575
Default Programming pasting charts to work problem

Dean,

You could try using CopyPicture. It's also more memory efficient since it is
not embedding the underlying chart data in the word document. However, if
you do it repeatedly you'll eventually see a bug that the method fails so
add some error handing and a retry routine.

Sub Macro1()
Dim oWord As Word.Application
'set a reference to Word object library for the project
'chart 1 has round corners
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.ChartArea.Select
ActiveChart.CopyPicture Appearance:=xlPrinter, Size:=xlScreen, Format:= _
xlPicture
Set oWord = GetObject(, "Word.Application")
With oWord
'this gives round corners in Word 10
.Documents.Add
.Selection.Paste
End With
End Sub

Robin Hammond
www.enhanceddatasystems.com

"Dean" wrote in message
...
I am atomating report production using Excel and word. The basic operation
is
ok I use bookmarks in word to position tables an charts pasted from Excel.
My problem is that the report designers have specified round corners to
the
chart borders. This is no problem to set up in Excel and manually pasting
the
chart to Word works fine. However doing it by programming turns the round
corners to square ones! Why?
I use the code below to paste the charts - My thanks for any suggestions

With rbmReport
.Select
xlWSheet.ChartObjects(cArray(iLoop)).Copy
.PasteSpecial _
Link:=False, _
Placement:=wdInLine, _
DataType:=wdPasteEnhancedMetafile
End With


--
Dean Mann



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 93
Default Programming pasting charts to work problem

Thank you Robin I shall try this method. I note your caution about the bug
and I am doing it repeatedly for different graphs so It will probably apply.

I assume the problem with the method I was using is a bug.
--
Dean Mann


"Robin Hammond" wrote:

Dean,

You could try using CopyPicture. It's also more memory efficient since it is
not embedding the underlying chart data in the word document. However, if
you do it repeatedly you'll eventually see a bug that the method fails so
add some error handing and a retry routine.

Sub Macro1()
Dim oWord As Word.Application
'set a reference to Word object library for the project
'chart 1 has round corners
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.ChartArea.Select
ActiveChart.CopyPicture Appearance:=xlPrinter, Size:=xlScreen, Format:= _
xlPicture
Set oWord = GetObject(, "Word.Application")
With oWord
'this gives round corners in Word 10
.Documents.Add
.Selection.Paste
End With
End Sub

Robin Hammond
www.enhanceddatasystems.com

"Dean" wrote in message
...
I am atomating report production using Excel and word. The basic operation
is
ok I use bookmarks in word to position tables an charts pasted from Excel.
My problem is that the report designers have specified round corners to
the
chart borders. This is no problem to set up in Excel and manually pasting
the
chart to Word works fine. However doing it by programming turns the round
corners to square ones! Why?
I use the code below to paste the charts - My thanks for any suggestions

With rbmReport
.Select
xlWSheet.ChartObjects(cArray(iLoop)).Copy
.PasteSpecial _
Link:=False, _
Placement:=wdInLine, _
DataType:=wdPasteEnhancedMetafile
End With


--
Dean Mann




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
Pasting Charts into Word then resizing them [email protected] Excel Discussion (Misc queries) 1 July 19th 07 09:35 PM
Programming Charts Pedro Charts and Charting in Excel 0 November 14th 05 04:23 PM
programming cell autofit doesn't work? Philippe[_4_] Excel Programming 2 January 14th 05 07:03 PM
Programming Organisation Charts Max Power Excel Programming 2 November 18th 04 04:09 PM
Programming to make graph work. Adam Hicks Excel Programming 3 May 18th 04 04:25 PM


All times are GMT +1. The time now is 10:28 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"