Runtime 429 on Mac when starting Word from Excel using VBA

D

Dave

Hi!
I am trying to start up Microsoft Word from a macro in Excel by using the
following statement:

Set appWD = CreateObject("Word.Application.8")

It works fine on my PC with Windows XP, however, when I run it on the Mac
I get the Runtime 429 error.

Could somebody give me a hint on how to solve this.

Thanks

/Dave
 
J

JE McGimpsey

Dave said:
I am trying to start up Microsoft Word from a macro in Excel by using the
following statement:

Set appWD = CreateObject("Word.Application.8")

It works fine on my PC with Windows XP, however, when I run it on the Mac
I get the Runtime 429 error.

Could somebody give me a hint on how to solve this.

The problem you're having is that Mac applications are single instance,
so if Word is running, you can't create a new object.

Try something like:

Dim oWdApp As Object
        On Error Resume Next
       Set oWdApp = GetObject(, "Word.Application")
       On Error GoTo 0
       If oWdApp Is Nothing Then _
Set oWdApp = CreateObject("Word.Application ")

 
 
W

Word Heretic

G'day Dave <[email protected]>,

Try asking on the Mac Word groups.

Steve Hudson - Word Heretic

steve from wordheretic.com (Email replies require payment)
Without prejudice


Dave reckoned:
 
J

Jim Gordon MVP

Hi,

This code opens Microsoft Word from Excel

Sub OpenMSWord()
Application.ActivateMicrosoftApp xlMicrosoftWord
End Sub

-Jim
 

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