Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default Excel to Word and back again

I have the following code.
Range("A7:N7").Select
Selection.Copy
Dim appWD As Word.Application
Dim odoc As Word.Document
Set appWD = CreateObject("Word.Application")
appWD.Visible = True
Set odoc = appWD.Documents.Add
odoc.Range.PasteExcelTable False, False, False
Set appWD = Nothing

And it works but I want to copy multiple ranges, I can set up the loop
required but how do I switch back and forth between the applications. When I
try Application.ActivateMicrosoftApp xlMicrosoftExcel it brings up the
calculator????


  #2   Report Post  
Posted to microsoft.public.excel.programming
Ed Ed is offline
external usenet poster
 
Posts: 399
Default Excel to Word and back again

You should have an object set to your Excel Workbook.
objYourXLWKbObject.Activate should be what you need.
Ed

"Rominall" wrote in message
...
I have the following code.
Range("A7:N7").Select
Selection.Copy
Dim appWD As Word.Application
Dim odoc As Word.Document
Set appWD = CreateObject("Word.Application")
appWD.Visible = True
Set odoc = appWD.Documents.Add
odoc.Range.PasteExcelTable False, False, False
Set appWD = Nothing

And it works but I want to copy multiple ranges, I can set up the loop
required but how do I switch back and forth between the applications.

When I
try Application.ActivateMicrosoftApp xlMicrosoftExcel it brings up the
calculator????




Reply
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
Excel 2007-send Word Art text to back tinks Excel Discussion (Misc queries) 3 May 4th 09 06:20 PM
Long text, Excel to Word, then back again Geoff C Excel Discussion (Misc queries) 0 December 3rd 08 03:14 PM
Excel 2007 opens in word, how do you default back to Excel? Leger Claude Comeau Excel Discussion (Misc queries) 1 May 14th 07 12:18 AM
Excel document was saved to word in error how do I get it back Janice Excel Discussion (Misc queries) 1 May 29th 06 03:45 PM
Embedded word doc changed to image-need to change back to word. cflores Excel Discussion (Misc queries) 0 January 23rd 05 06:45 AM


All times are GMT +1. The time now is 09:30 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"