ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   runtime error -429 (https://www.excelbanter.com/excel-programming/363677-runtime-error-429-a.html)

skibikegolf

runtime error -429
 
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



[email protected]

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



skibikegolf

runtime error -429
 
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




[email protected]

runtime error -429
 
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






All times are GMT +1. The time now is 03:46 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com