Timeout on "SET statement" or "Documents.open". Solution? 
Author Message
 Timeout on "SET statement" or "Documents.open". Solution?

'------- Begin Code --------'
Dim  objWord  As  Word.Application
Dim  objDoc  As  Word.Document

Set  objWord = CreateObject("Word.Application")

' create the WORD97 doc instance
Set objDoc = New Word.Document
' The problem is in the following line of code
Set objDoc = objWord.Documents.Open("\\MyServer\MyDocument.doc", False,
'------ End of Code --------'

This piece of code works fine and the "MyDocument.doc" is opend by Word when
the connection to "MyServer" is NOT slow. But when the connection is slow,
it tries maybe for 5 seconds to open "MyDocument.doc" with no success. It
does not give an error, but it does not open it. I can open
"\\MyServer\MyDocument.doc" by going to Windows Explorer and double clicking
on the file. It does take a few seconds to open, but eventually it opens it.
It seems that there is a timeout on trying to execute the line:
Set objDoc = objWord.Documents.Open("\\MyServer\MyDocument.doc", False,

The question: is there a way to solve this problem by forcing the above
statement to open the document without timeout or by prolonging the timeout?
or is there any other solution?

N.B. "MyServer" is a Novell 3.11

Thank You. Your help will be highly appreciated.


Fri, 28 Jun 2002 03:00:00 GMT  
 Timeout on "SET statement" or "Documents.open". Solution?
Hi Khodr,

I have no idea whether it will affect the problem you're here about,
but: you can delete the following line of code. Setting an object
variable of type Word.Document to a document, using the Documents.Open
or Documents.Add method is sufficient.

> ' create the WORD97 doc instance
> Set objDoc = New Word.Document

Cindy Meister
INTER-Solutions, Switzerland

This reply is posted in the Newsgroup; please post any follow question
or reply in the newsgroup and not by e-mail :-)

Sun, 30 Jun 2002 03:00:00 GMT  
 [ 2 post ] 

 Relevant Pages 

1. *"*-.,._,.-*"* I"LL TRADE VISUAL C++ FOR VBASIC *"*-.,_,.-*"*

2. Please, please!!!(about "Set" statement)

3. GetObject("","InternetExplorer.Application") fails in Excel VBA

4. SysCmd 603, "path","path"

5. Disabling "BACK"/"FORWARD" buttons

6. ADO "Open" Statement

7. Loop print "VARIABLE", "VARIABLE"

8. DLL or something like "#"#ยค#"!"#

9. Disabling "BACK"/"FORWARD" buttons

10. CreateObject("Excel","//server"), MsgBox output

11. Problem With "window.showmodaldialog("")"

12. CreateObject("Excel","//server"), MsgBox output


Powered by phpBB® Forum Software