Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / February 2006

Tip: Looking for answers? Try searching our database.

Copying a range from excel into word

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Rominall - 14 Feb 2006 19:41 GMT
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?
Doug Robbins - Word MVP - 14 Feb 2006 20:30 GMT
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?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.