I want to resize a Chart object. I am creating a graph from a set of data in Excel and inserting the graph in a Word doc via VBA.
I tried to use .Width property from the ChartObjects object but I couldn't extend this to chart. ( I got an application error with ws1.ChartObjects.)
Sub CPU_Top_10_Chart()
Dim wdApp As Word.Application
Dim wdDoc As Word.Document
Dim cht As Chart
Dim ws1 As Worksheet
Set wdApp = CreateObject("Word.Application")
Set wdDoc = wdApp.Documents.Add("C:\...\chart_test.docx")
Set cht = Charts.Add
Set ws1 = ActiveWorkbook.Sheets("Sheet1")
With cht
.SetSourceData Source:=ws1.Range("A2:C12")
.ChartType = xlColumnClustered
End With
cht.CopyPicture
wdDoc.Bookmarks("insert_chart").Range.Paste
End Sub