Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11
Default Copying charts from excel into word

Hi,

I would like to copy a chart from excel into word. I've tried to make a
macro see below, but it stops with:
" Worksheets("ReportFS").ChartObjects("CS_FS").CopyP icture". Could
somebody help me please?
Thanks in advance.
Anita

Sub Openfile()
Dim templateName As String
Dim arrGraphBookmarks As String
Set appWD = CreateObject("Word.Application")
dirnaam = "D:\"
templateName = "Layout rapport En.doc"
With appWD
.ChangeFileOpenDirectory dirnaam
.Documents.Open Filename:=templateName, ReadOnly:=True
.Visible = True
.ActiveDocument.ActiveWindow.WindowState =
wdWindowStateMinimize

End With
Worksheets("ReportFS").ChartObjects("CS_FS").CopyP icture
With appWD
.ActiveDocument.ActiveWindow.WindowState =
wdWindowStateMinimize
.Selection.Goto what:=wdGoToBookmark, Name:=CS_FS
.Selection.PasteSpecial Link:=False,
DataType:=wdPasteEnhancedMetafile, _
Placement:=wdWrapSquare, DisplayAsIcon:=False
End With

End Sub

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default Copying charts from excel into word

I can't test this, but try to select the chart object before copying it.
--
Gary's Student


"anita" wrote:

Hi,

I would like to copy a chart from excel into word. I've tried to make a
macro see below, but it stops with:
" Worksheets("ReportFS").ChartObjects("CS_FS").CopyP icture". Could
somebody help me please?
Thanks in advance.
Anita

Sub Openfile()
Dim templateName As String
Dim arrGraphBookmarks As String
Set appWD = CreateObject("Word.Application")
dirnaam = "D:\"
templateName = "Layout rapport En.doc"
With appWD
.ChangeFileOpenDirectory dirnaam
.Documents.Open Filename:=templateName, ReadOnly:=True
.Visible = True
.ActiveDocument.ActiveWindow.WindowState =
wdWindowStateMinimize

End With
Worksheets("ReportFS").ChartObjects("CS_FS").CopyP icture
With appWD
.ActiveDocument.ActiveWindow.WindowState =
wdWindowStateMinimize
.Selection.Goto what:=wdGoToBookmark, Name:=CS_FS
.Selection.PasteSpecial Link:=False,
DataType:=wdPasteEnhancedMetafile, _
Placement:=wdWrapSquare, DisplayAsIcon:=False
End With

End Sub


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11
Default Copying charts from excel into word

Thanks for the input, but unfortunately it doesn't work. Have you
perhaps got more suggestions?

Anita
Gary''s Student schreef:

I can't test this, but try to select the chart object before copying it.
--
Gary's Student


"anita" wrote:

Hi,

I would like to copy a chart from excel into word. I've tried to make a
macro see below, but it stops with:
" Worksheets("ReportFS").ChartObjects("CS_FS").CopyP icture". Could
somebody help me please?
Thanks in advance.
Anita

Sub Openfile()
Dim templateName As String
Dim arrGraphBookmarks As String
Set appWD = CreateObject("Word.Application")
dirnaam = "D:\"
templateName = "Layout rapport En.doc"
With appWD
.ChangeFileOpenDirectory dirnaam
.Documents.Open Filename:=templateName, ReadOnly:=True
.Visible = True
.ActiveDocument.ActiveWindow.WindowState =
wdWindowStateMinimize

End With
Worksheets("ReportFS").ChartObjects("CS_FS").CopyP icture
With appWD
.ActiveDocument.ActiveWindow.WindowState =
wdWindowStateMinimize
.Selection.Goto what:=wdGoToBookmark, Name:=CS_FS
.Selection.PasteSpecial Link:=False,
DataType:=wdPasteEnhancedMetafile, _
Placement:=wdWrapSquare, DisplayAsIcon:=False
End With

End Sub



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default Copying charts from excel into word

This did work (at least the copy part)

Sub Macro1()
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.ChartArea.Select
ActiveChart.ChartArea.Copy
End Sub

I could not record the paste in Word part.
--
Gary's Student


"anita" wrote:

Thanks for the input, but unfortunately it doesn't work. Have you
perhaps got more suggestions?

Anita
Gary''s Student schreef:

I can't test this, but try to select the chart object before copying it.
--
Gary's Student


"anita" wrote:

Hi,

I would like to copy a chart from excel into word. I've tried to make a
macro see below, but it stops with:
" Worksheets("ReportFS").ChartObjects("CS_FS").CopyP icture". Could
somebody help me please?
Thanks in advance.
Anita

Sub Openfile()
Dim templateName As String
Dim arrGraphBookmarks As String
Set appWD = CreateObject("Word.Application")
dirnaam = "D:\"
templateName = "Layout rapport En.doc"
With appWD
.ChangeFileOpenDirectory dirnaam
.Documents.Open Filename:=templateName, ReadOnly:=True
.Visible = True
.ActiveDocument.ActiveWindow.WindowState =
wdWindowStateMinimize

End With
Worksheets("ReportFS").ChartObjects("CS_FS").CopyP icture
With appWD
.ActiveDocument.ActiveWindow.WindowState =
wdWindowStateMinimize
.Selection.Goto what:=wdGoToBookmark, Name:=CS_FS
.Selection.PasteSpecial Link:=False,
DataType:=wdPasteEnhancedMetafile, _
Placement:=wdWrapSquare, DisplayAsIcon:=False
End With

End Sub




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
Issues copying excel charts to word documents - using Excel VBA Frankie Excel Worksheet Functions 0 April 20th 06 03:39 PM
Linking table in Excel to word travis Links and Linking in Excel 1 November 19th 05 02:30 PM
in an excel macro can you import data from word into a cell? Trefor Excel Discussion (Misc queries) 11 October 6th 05 01:49 PM
I'm loosing colour when copying charts from excel to word. Ched76 Charts and Charting in Excel 1 June 8th 05 03:12 AM
Copying Excel object back into Excel from Word Regina Excel Discussion (Misc queries) 2 March 29th 05 06:57 PM


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