Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

GetObject is not responding

Status
Not open for further replies.

mcetraro

Programmer
Apr 19, 2004
4
US
I have the following code at the beginning of my program. I need to know if there is a running instance of Word running before I create one. I have seen in many examples the use of "GetObject" to figure out if there is an instant running. But it is not working for me. What am I doing wrong?. Always I get the error number "429" even having several instances of Word openned. Thanks for your help.


'
On Error Resume Next

' Check if there is a Word Application open.
Set WordApp = GetObject("", "Word.Aplplication")
theerror = Err.Number
If Err.Number <> 0 Then
' Creating a MS Word application object.
GoSub P050_Set_Word
Else
AnswerSel = MsgBox("There is a Word Application openned." & Chr(10) & "Please proceed to close it before starting the program.", vbOKOnly, "Word Document Opened")
End If

 
If running on Win9x (95/98/ME) this is 'standard procedure', or 'an issue' in M$ speak. If not there's a typo somewhere in your code ;-)

HTH
TonHu
 
Is that actually your code ?

Set WordApp = GetObject("", "Word.Aplplication")

Because Application is spelt wrong .. but maybe you just typed that wrong when you put it in your question here?

Transcend
[gorgeous]
 
Hello mcetraro,

Typo apart, the functionality you want to get to is this.
Code:
Set WordApp = GetObject(, "Word.Application")
(see the difference?)

regards - tsuji
 
Thank you. There was a typo. I corrected it and it is working fine now.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top