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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Checking for Word being open

Status
Not open for further replies.

Domino2

Technical User
Jun 8, 2008
475
GB
Is this code allowed as a check to see if Word is open before opening a second instance. I trapped error numbers and there were only 2 on my PC which are used to escape the procedure if word is not open. Thanks

Private Sub Command276_Click()

On Error GoTo Command276_Click_Error

WD.Application.Quit
On Error GoTo 0
Exit Sub

Command276_Click_Error:
If Err.Number = 462 Or Err.Number = 91 Then
Exit Sub
End If

End Sub
 



Please post VBA questions in Forum707 for better results.

Skip,
[glasses]Don't let the Diatribe...
talk you to death![tongue]

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top