Why this don't work

F

Fernando Ortiz

Hi Excel Experts:

Why this code don`t work, I already create a reference to the Word type
library

Sub WordControl()
Dim appWd As Word.Application
'line of error
Set appWd = Application.ActivateMicrosoftApp xlMicrosoftWord
...More lines of code
appWd.Quit
End Sub

Win XP pro, Excel 2002

Thanks for any advice

Regards

Fernando Ortiz
 
C

Chip Pearson

ActivateMicrosoftApp does not return a reference to the activated
application. Instead, use GetObject.

Set appWd = GetObject(,"Word.Application")


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 

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