Excel to Word and back again

G

Guest

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????
 
E

Ed

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

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