Copy a Chart from Excel to word without Links

drom

Active Member
Joined
Mar 20, 2005
Messages
470
Office Version
  1. 2019
  2. 2016
  3. 2013
  4. 2011
  5. 2010
  6. 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

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.

DanteAmor

Well-known Member
Joined
Dec 3, 2018
Messages
14,173
Office Version
  1. 2007
Platform
  1. Windows
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.
 
Solution
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,151,958
Messages
5,767,321
Members
425,404
Latest member
Bairkus

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
Top