Short intro - this is a Winform program which can generate MS Word reports.
An error is created when a user trys to shut down the generating word report before the processing is complete (ie if its a long document and the user closes word)
Is there a way to prevent this error or process msword in the background so the user cant interact with it until its finished?
An error is created when a user trys to shut down the generating word report before the processing is complete (ie if its a long document and the user closes word)
Code:
System.Runtime.InteropServices.COMException
HResult=0x80010001
Message=Call was rejected by callee. (Exception from HRESULT: 0x80010001 (RPC_E_CALL_REJECTED))
Source=<Cannot evaluate the exception source>
StackTrace:
<Cannot evaluate the exception stack trace>
Code:
Dim oWord As Word.Application
oWord = New Word.Application
oWord.Documents.Add("\List.dot")
oWord.Visible = True
oWord.Activate
With oWord.ActiveDocument
' do word stuff
End With
oWord = Nothing