Importing Excel Range data to Word doc

harshi7

New Member
Joined
Jun 11, 2019
Messages
9
Hello All,

I need to import an excel 'Range' which contains texts and images into Word document. I have used the below code.
Problem is images are misplaced after importing into word document and few images are above the text content.

how do i maintain the structured format even after importing? Please help

Code:

Sub SaveDoc()
Dim rangetocopy As Range
Dim WordApp As Word.Application
Dim myDoc As Word.Document
Dim WordTable As Word.Table




Set rangetocopy = Range("A1:C203")
Set WordApp = New Word.Application
WordApp.Visible = True
Set myDoc = WordApp.Documents.Add
rangetocopy.Copy
myDoc.Words(1).PasteExcelTable False, False, False


End Sub
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
You might try varying your PasteExcelTable arguments. Otherwise, you might try:
myDoc.Range.PasteSpecial DataType:=wdPasteOLEObject
to insert the actual worksheet, or:
myDoc.Range.PasteAndFormat wdChartPicture
to insert the content as an image.
 
Upvote 0
Hello Paul,

thanks for your reply. I tried changing the PasteExcelTable arguments, I am getting the contents in word as tabular form (I will not be able to edit the word contents properly). But I need the word contents to be in normal format where I can edit the word document easily.
Please suggest
 
Upvote 0
Provided the first argument is kept 'False' , either of the second two of the .PasteExcelTable arguments will allow you to edit the content in Word - as will .PasteSpecial DataType:=wdPasteOLEObject.
 
Upvote 0
If i use .PasteExcelTable with second arguments as False True False -Entire excel range content will be saved in word as table format and same result with paste special. If I use False False True - Each excel cell content is saved as tabular form. I cannot give backspace or edit the contents properly
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,021
Latest member
Justyna P

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