runtime error -429
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
skibikegolf wrote:
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
|