F
free.teranews.com
I'm absolutely stuck.
The following code works perfectly the first time through, but when run
again fails with an error 462 (the remote server machine does not exist or
is unavailable). Simply resetting from the error and running again and it
works fine for one time only. There is no problem if you close the file,
open it again and close it again.
Closing the Form makes no difference, only closing the application puts
things back right
I've tried similar code calling an Excel file with no problems at all.
Help would be much appreciated.
Geoff
Public Sub Combo4_Click()
Dim objword As Word.Application
On Error Resume Next
Set objword = GetObject(, "Word.Application")
If objword Is Nothing Then
Set objword = New Word.Application
End If
On Error GoTo 0
objword.Visible = True
Documents.Open ("C:\windows\application data\microsoft\templates\u3a.dot")
Documents.Close
Set objword = Nothing
Word.Application.Quit
End Sub
The following code works perfectly the first time through, but when run
again fails with an error 462 (the remote server machine does not exist or
is unavailable). Simply resetting from the error and running again and it
works fine for one time only. There is no problem if you close the file,
open it again and close it again.
Closing the Form makes no difference, only closing the application puts
things back right
I've tried similar code calling an Excel file with no problems at all.
Help would be much appreciated.
Geoff
Public Sub Combo4_Click()
Dim objword As Word.Application
On Error Resume Next
Set objword = GetObject(, "Word.Application")
If objword Is Nothing Then
Set objword = New Word.Application
End If
On Error GoTo 0
objword.Visible = True
Documents.Open ("C:\windows\application data\microsoft\templates\u3a.dot")
Documents.Close
Set objword = Nothing
Word.Application.Quit
End Sub