After pasting the first image, try executing a code like this:
WrdDoc.InlineShapes(1).ScaleWidth = 80
WrdDoc.InlineShapes(1).ScaleHeight = 80
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
For my company one of the processes is copying graphs from an Excel spreadsheet and pasting them into a word document. However, these graphs are pasted slightly too big and need to be descaled to 80% their original size. I'm trying to write a macro in excel that will copy these graphs, paste them in and then reduce their size in word. From research online this is what I have so far:
Sub ExportChartToWord()
Dim WrdApp As Word.Application
Dim WordDoc As Word.Document
Dim Chrt As ChartObject
Set WrdApp = New Word.Application
WrdApp.Visible = True
WrdApp.Activate
Set WrdDoc = WrdApp.Documents.Add
'chart 1
Set Chrt = ActiveSheet.ChartObjects(1)
Chrt.Chart.ChartArea.copy
With WrdApp.Selection
.PasteSpecial Link:=False, DataType:=15, Placement:=wdInLine, _
DisplayAsIcon:=False
End With
End Sub
For simplicity I have only included one of the 4 charts in the following code but the other 3 are just the same line of code.
I would be very greatful for any support I could get. it seems like a simple problem but I just cant work it out!
Thanks,
Archie.
After pasting the first image, try executing a code like this:
WrdDoc.InlineShapes(1).ScaleWidth = 80
WrdDoc.InlineShapes(1).ScaleHeight = 80