deenoseban
New Member
Hi,
I am trying to copy a range from excel and paste it as an image in word file, able to copy and open my word file but somewhere am getting an error and not able to paste.
>>> use code - tags <<<
I am trying to copy a range from excel and paste it as an image in word file, able to copy and open my word file but somewhere am getting an error and not able to paste.
>>> use code - tags <<<
Code:
Sub myexcel_to_word ()
Dim mytbl As Excel.Range
Dim WordApp As Object
'this code copy my dynamic range in excel
Set mytbl = Range(("A7"), ActiveCell.SpecialCells(xlLastCell))
mytbl.Copy
'this code opens my letterhead from my desktop
Set WordApp = CreateObject("word.Application")
WordApp.Documents.Open "C:\Users\dss\Desktop\Invoice_Generate\Letterhead.docx"
WordApp.Visible = True
'this code paste the data as image in word, but....
Selection.PasteSpecial Link:=False, DataType:=wdPasteEnhancedMetafile, _Placement:=wdInLine, DisplayAsIcon:=False
End Sub
Last edited by a moderator: