runtime error -429

G

Guest

I have an office application the uses excel, word, and outlook to email 10-15
clients a week.

This application worked this morning, but I now get the following error
while running vba code from excel:

Run-time error "429"
Axtive X component can't create object

The offending line of code is:

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

I did go into system restore to move the system back to yesterday, yet I
still get the same problem. I did install the Office xp3 update this
morning, so that may have something to do with the problem.

Any help is appreciated.

skibikegolf
 
P

paul.robinson

Hi
Try this. Your code, as is, will fail if Word is not already open.

On Error Resume Next
Err.Clear
Set wdApp = GetObject(, "Word.Application")
If Err.Number <> 0 Then WordWasRunning = False Else
WordWasRunning = True
On Error GoTo 0
Err.Clear 'keep err tidy
If Not WordWasRunning Then
Set wdApp = CreateObject("Word.Application") 'fresh version
of Word
End If

regards
Paul
 
G

Guest

Paul,

Thanks for the suggested code, I do have similar code:

Set wdApp = GetObject(, "Word.Application")
If Err <> 0 Then 'Word was not running
Set wdApp = CreateObject("Word.Application")
aStarted = True
End If

However, what is interesting, all of a sudden my code is again running fine
with no runtime errors. Should I be scared :)

skibikegolf
 

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