I have an excel sheet in which there are several named ranges. I would like
to write a macro to copy the information, create a new word doc and then
paste into the new word doc. Do I write it from excel or from word. How do
I control the paste function?
See the article "Control Excel from Word" at:
http://www.word.mvps.org/FAQs/InterDev/ControlXLFromWord.htm
or
"Control Word from Excel" at:
http://www.word.mvps.org/FAQs/InterDev/ControlWordFromXL.htm

Signature
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP
>I have an excel sheet in which there are several named ranges. I would
>like
> to write a macro to copy the information, create a new word doc and then
> paste into the new word doc. Do I write it from excel or from word. How
> do
> I control the paste function?
Rominall - 14 Feb 2006 22:37 GMT
Thanks for the articles but when I add the code into the excel document I get
a "doesn't support this property or method"
Here's the code I have.
Dim appWD As Word.Application
Dim odoc As Word.Document
Range("A7:N7").Select
Selection.Copy
Application.CutCopyMode = False
Set appWD = CreateObject("Word.Application")
Set odoc = appWD.Documents.Add
WordBasic.EditOfficeClipboard
Selection.PasteExcelTable False, False, False <==== this is where it
error's out
Set appWD = Nothing
Would it be easier to do this from word?
> See the article "Control Excel from Word" at:
>
[quoted text clipped - 12 lines]
> > do
> > I control the paste function?
Doug Robbins - Word MVP - 15 Feb 2006 18:58 GMT
Use
odoc.Range.PasteExcelTable False, False, False

Signature
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP
> Thanks for the articles but when I add the code into the excel document I
> get
[quoted text clipped - 36 lines]
>> > do
>> > I control the paste function?