Hi
Some thoughts:
1. did you set wrdApp to nothing at the end (plus the other word
objects in the right order)
2. Did you clean your code using Rob Bovey's code cleaner:
http://www.appspro.com/Utilities/CodeCleaner.htm
This can often clear up mysterious glitches.
regards
Paul
skibikegolf wrote:
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
" wrote:
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