LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 47
Default Copy Paste from Excel to specified word document

Ok. I've got the below code and it seems to work fine all the way up to where
it's going to paste into word (last sub) and it has an error. I want it to
paste the copied cells in to word (as unformatted text). It keeps throwing up
an error runtime error 1004. Any ideas?



Sub CopyCellsFromExcel()

Dim wordApp As Object
Dim fNameAndPath As String
Dim wdPastetext As String

ActiveSheet.Range("I5:I49").Copy
Application.CutCopyMode = False

Sub OpenAWordFile()


fNameAndPath = "C:\Documents and Settings\tom.jordan\My
Documents\Projects\FFEC Headed Paper.doc"
Set wordApp = CreateObject("Word.Application")
wordApp.Documents.Open (fNameAndPath)
wordApp.Visible = True

Selection.PasteSpecial DataType:=wdPastetext

End Sub
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
PASTE LINK option not available when I select PASTE SPECIAL to link an image in Excel to a Word document. tln Links and Linking in Excel 0 April 22nd 07 04:28 PM
How do I paste a Word document into an Excel cell callawayx18 Excel Discussion (Misc queries) 0 January 10th 07 10:46 PM
copy multiple worksheets of a workbook, and paste onto a Word document ( either create new doc file or paste onto an existing file.) I need this done by VBA, Excel Macro Steven Excel Programming 1 October 17th 05 08:56 AM
Copy a form from excel into a new word document kevin Excel Programming 3 January 28th 05 04:15 PM
Excel VBA - Easy way to paste chart to word document ? JtR Excel Programming 6 June 10th 04 08:24 AM


All times are GMT +1. The time now is 10:40 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"