drom
Well-known Member
- Joined
- Mar 20, 2005
- Messages
- 543
- Office Version
- 2021
- 2019
- 2016
- 2013
- 2011
- 2010
- 2007
Hi and thanks in advance!
I have the following macro:
My Problem, when I paste this Chart in a NewDocument in Word, the chart comes linked to the Excel Sheet, despite:
But Always comes linked
I do not want to Save the Chart as picture and then Open this image from Excel /VBA to insert the Chart in Word
2) when The Linked chart is pasted in Word, I do not know why, but I have to resize the Chart because The image/Chart does not appear/show like in Excel
Comes smaller
But I do not know how to resize the pasted Chart
My priority is my question 1, because I know how to resize a inserted shape/Picture/Image in Word from EXCEL
Thanks again!
I am just trying to Cpy and Paste from Excel a Chart to Word but as image or without links
I am asking 2 questions because I guess they are linked
I have the following macro:
VBA Code:
Sub CopyPasteChartXFromExceltoWordWithoutLinks()
On Error Resume Next: Application.ScreenUpdating = False
Dim WKBvba As Workbook: Set WKBvba = ThisWorkbook
Dim obChart As ChartObject: Set obChart = ThisWorkbook.Sheets("SheetName").ChartObjects("ChartName")
Dim WordApp As Object: Set WordApp = GetObject(, "Word.Application")
Dim WordDoc As Object
Dim WordRng As Object
If WordApp Is Nothing Then
Set WordApp = CreateObject("Word.Application")
End If
WordApp.Visible = True
Set WordDoc = WordApp.Documents.Add
WordDoc.Select
obChart.Chart.ChartArea.Copy
Application.Wait Now + TimeValue("00:00:02")
With WordApp.Selection
.PasteSpecial link:=False ', DataType:=wdPasteOLEObject
End With
'If I put DataType:=wdPasteOLEObject I get one Error because VBA does not recognise wdPasteOLEObject
'Anyway, I do not care since I do not know what does DataType:=wdPasteOLEObject mean ...
'This comes from one other Excel query in mrExcel
End Sub
My Problem, when I paste this Chart in a NewDocument in Word, the chart comes linked to the Excel Sheet, despite:
- PasteSpecial link:=False
But Always comes linked
I do not want to Save the Chart as picture and then Open this image from Excel /VBA to insert the Chart in Word
- What am I missing ?
2) when The Linked chart is pasted in Word, I do not know why, but I have to resize the Chart because The image/Chart does not appear/show like in Excel
Comes smaller
But I do not know how to resize the pasted Chart
My priority is my question 1, because I know how to resize a inserted shape/Picture/Image in Word from EXCEL
Thanks again!
I am just trying to Cpy and Paste from Excel a Chart to Word but as image or without links
I am asking 2 questions because I guess they are linked