LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Crash on every 2nd run

The previuous message got fired too quickly. Another try:
Gents,

I get the following behaviour:

In a macro, I open a word doc, and close it again with
the following code:

'open word document
Dim infoDocument As Object
Set infoDocument = CreateObject("Word.Basic")
On Error Resume Next
Set infoDocument = Word.Documents.Open(fileAddress,0,
True, False)

If Err.Number = 0 Then

'do some stuff

end if

'Close the document
infoDocument.Close
If Word.Documents.Count = 0 Then
Word.Application.Quit
End If



The problem is now that the first time after the excel
file is opened, the macro works fine. From the second
time on, it stops working with the following error:
'The remote server machine does not exsist or is
unavailable. From VBAProject'

Can anybody explain/improve my code.

regards,
Christof
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why does this macro crash? Brian Excel Discussion (Misc queries) 6 May 11th 08 08:46 PM
VB Crash - Little Bit Of Fun RajenRajput1 Excel Discussion (Misc queries) 4 May 21st 07 02:35 PM
Excel Crash - Help! Delbert Excel Discussion (Misc queries) 13 December 13th 05 10:02 PM
Crash martin Excel Discussion (Misc queries) 2 July 13th 05 09:36 PM
Crash on every 2nd run Christof[_4_] Excel Programming 0 September 29th 03 07:57 AM


All times are GMT +1. The time now is 04:40 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"