chandrashekar
Well-known Member
- Joined
- Jul 15, 2005
- Messages
- 529
- Office Version
- 365
- Platform
- Windows
Hi,
am trying to paste excel graph to word using vbacode(using word) but I need to paste it in particular positions. May I know how to do it?
Please find below code which am using now.
am trying to paste excel graph to word using vbacode(using word) but I need to paste it in particular positions. May I know how to do it?
Please find below code which am using now.
Code:
Sub excel2word()
Dim oExcel As Excel.Application
Dim oWB As Workbook
Set oExcel = New Excel.Application
Set oWB = oExcel.Workbooks.Open("C:\Users\Chandra.char\Desktop\Test\VR.xls")
oExcel.Visible = True
oWB.Sheets("ViolationCount_Week").Select
Set Chart = oWB.Sheets("ViolationCount_Week").ChartObjects("Chart 6")
Chart.Copy
'Chart.ChartArea.Copy
With ActiveDocument.Sections(1).Range
.PasteSpecial Link:=False, DataType:=wdPasteBitmap, _
Placement:=wdInLine, DisplayAsIcon:=False
End With
Set oExcel = Nothing
Set oWB = Nothing
Set Chart = Nothing
End Sub
Last edited by a moderator: