Cell to Cell Data Transfer

B

binar

Fellow Forum Members,
I need to transfer data cell for cell from Excel into an existing table in
Word 2003. The table in Word utilizes headers. The problem I am encountering
is that the code does not recognize the headers and is not transfering the
data cell to cell. Can anyone out there help me out with some coding that
will accomplish this task? Any help will be greatly appreciated.

Below is the code I would like to modify to accomplish the task of
transfering data from Excel to Word table. If there is a better code out
there please let me know. Thanks.

It will open a word document named test.doc it will then select the bookmark
named test. It will then copy the range A1:E401 from the active workbook to
the word document at the point in the document where the test bookmark occurs.


VB: AutoLinked keywords will cause extra spaces before keywords. Extra
spacing is NOT transferred when copy/pasting, but IS if the keyword uses
"quotes".
Dim wdApp As Object
Dim wd As Object
Dim oIshp As Object


On Error Resume Next
Set wdApp = GetObject(, "Word.Application")
If Err.Number <> 0 Then
Set wdApp = CreateObject("Word.Application")
End If
On Error Goto 0

Set wd = wdApp.Documents.Open("C:\test.doc")

wdApp.Visible = True

Range("A1:E401").Copy

wd.Bookmarks("test").Select

wdApp.Selection.PasteExcelTable False, False, Fals
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top