A
anita
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").CopyPicture". 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").CopyPicture
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
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").CopyPicture". 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").CopyPicture
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