I am using Microsoft Word as my reporting tool for a VB app. Everything works fine on my development PC, but on a couple of other PCs VB crashes with 'invalid page fault in OLE32.DLL'. We've installed the msot recent version of DCOM95 and that didn't make a difference.

The code is as follows:

Set m_wrdReport = New Word.Application
m_wrdReport.Documents.Open (App.Path & "\Templates\Par.doc")

.
.
.

With m_wrdReport.Selection.Find
.ClearFormatting
.Text = sHeader
.Execute Forward:=True
End With

Clipboard.Clear
Clipboard.SetText (sData)
m_wrdReport.Selection.Paste
Clipboard.Clear

When the program tries to execute the ClearFormatting method, VB crashes. What this code is doing is looking for a specific word in the document (located in the sHeader variable) and replacing it with another value (in the sData variable).