I had this problem today and went searching for an answer in P2P and couldn't find any similar threads. I have found a solution, but thought I'd document it here for others who might need it.
Here is a code fragment:
Code:
Dim appWord As Word.Application, wrdDoc As Word.Document
On Error Resume Next
'Use word to open the output file
Set appWord = CreateObject("Word.Application")
On Error GoTo appWordError
Set wrdDoc = appWord.Documents.Open(g.strPAMPath & "F" & j.RunJobID & ".p1")
It was failing with Object variable or with block not set on the "set wrdDoc =" line.
The cause of the problem turns out to be that this computer had a more recent version of MS Office (2007) installed, then we reverted back to an older version (2003).
To resolve:
Open Add or Remove Programs
Find the Microsoft Office 2007 Primary Interop Assemblies
Click the remove button