Copy a Chart from Excel to word without Links

drom

Well-known Member
Joined
Mar 20, 2005
Messages
527
Office Version
  1. 2021
  2. 2019
  3. 2016
  4. 2013
  5. 2011
  6. 2010
  7. 2007
Hi and thanks in advance!

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
1) I am trying to Paste a Chart from Excel to Word
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
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Try this:

Rich (BB code):
WordApp.Selection.PasteAndFormat 13

Check in the following link what is the number you need and change it in the code.
 
Upvote 0
Solution

Forum statistics

Threads
1,214,646
Messages
6,120,715
Members
448,985
Latest member
chocbudda

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top