MacroAlan
New Member
- Joined
- Aug 30, 2004
- Messages
- 31
It seemed like it should be so easy. I'm creating a bunch of data from Access and sending to Excel and then creating a bunch of Charts.
Charts look good. As each is created, I want to copy it and paste into a Word document.
It's been years since I've done any Word programming in VBA.
Charts look good. As each is created, I want to copy it and paste into a Word document.
Code:
Set WDapp = CreateObject("Word.Application")
WDapp.Documents.Open RptPath & RptName & WDdate
'Translates to “History Data_20170828.docx”
'------------------ other stuff
For Z = 1 To ActiveSheet.ChartObjects.Count
With ActiveSheet.ChartObjects(Z)
.Left = Range("K" & LftRow).Left
.Top = Range("K" & LftRow).Top
.Width = 800
.Height = 525
.Copy
End With
WDapp.activedocument.PasteSpecial Link:=False, DataType:=wdpastetext, Placement:=wdinline, displayasicon:=False 'This line fails
It's been years since I've done any Word programming in VBA.