Hi friends,

I want to copy few cells of an excel sheet and paste special(picture) in ms-word. I want to develop a vb code code for this.

Please help!...

Regards,
Dinil

Do u want to write this code :

a) from within an Excel file in VBA Editor?

OR

b) from within Word file in VBA Editor?

OR

c) from VISUAL BASIC IDE?


Regards
Shaik Akthar

Hi,

Try This Code:

Dim exel As Object
Dim WBEx As Object
Dim ExelWS As Object
Dim appwd As Object

Set exel = CreateObject("Excel.Application")
Set WBEx = exel.Workbooks.Open("C:\Myexce.xls")
Set ExelWS = WBEx.Worksheets("Sheet1")
Set appwd = CreateObject("Word.Application")
appwd.Visible = True
appwd.Documents.Open FileName:="C:/doc1.doc"
ExelWS.Range("A1:D20").Select
Selection.Copy
appwd.Selection.PasteSpecial Placement:=wdInLine, DataType:=wdPasteMetafilePicture
appwd.Documents.Save
Set appwd = Nothing
Set ExelWS = Nothing
Set WBEx = Nothing
Set exel = Nothing

Change your range selection accordingly..

Regards
Veena

Hi friends

I need to a vb code under ms word that copy from a specifice cell in excell and past the value in ms word in a bookmark (field).

can you help
by the way i am using ms word 2003

many thanks,

khuraidah

Hi,

Try This Code:

Dim exel As Object
Dim WBEx As Object
Dim ExelWS As Object
Dim appwd As Object

Set exel = CreateObject("Excel.Application")
Set WBEx = exel.Workbooks.Open("C:\Myexce.xls")
Set ExelWS = WBEx.Worksheets("Sheet1")
Set appwd = CreateObject("Word.Application")
appwd.Visible = True
appwd.Documents.Open FileName:="C:/doc1.doc"
ExelWS.Range("A1:D20").Select
Selection.Copy
appwd.Selection.PasteSpecial Placement:=wdInLine, DataType:=wdPasteMetafilePicture
appwd.Documents.Save
Set appwd = Nothing
Set ExelWS = Nothing
Set WBEx = Nothing
Set exel = Nothing

Change your range selection accordingly..

Regards
Veena

This question has already been answered. Start a new discussion instead.