VBA Excel - Macro tells me Word Document is Open even though it is not open
<p>To start off I have a function in VBA Excel that tells me if a Word Document is open or not open. For testing purposes I don't have the Word Document Open and expect 'False' to be returned.</p>

<pre><code>Function IsFileOpen(filename As String) As Boolean
        Dim filenum As Integer, errnum As Integer

        On Error Resume Next   ' Turn error checking off.
        filenum = FreeFile()   ' Get a free file number.
        ' Attempt to open the file and lock it.
        Open filename For Input Lock Read As #filenum
        Close filenum          ' Close the file.
        errnum = Err           ' Save the error number that occurred.
        On Error GoTo 0        ' Turn error checking back on.

        ' Check to see which error occurred.
        Select Case errnum

            ' No error occurred.
            ' File is NOT already open by another user.
            Case 0
             IsFileOpen = False

            ' Error number for "Permission Denied."
            ' File is already opened by another user.
            Case 70
                IsFileOpen = True

            ' Another error occurred.
            Case Else
                Error errnum
        End Select

    End Function
</code></pre>

<p>Called Via:</p>

<pre><code>...
If IsFileOpen("C:/Temp/test.docx") = True Then
 MsgBox objWord.ActiveDocument.Name &amp; " already open" 'ERROR FROM PIC HERE
 Set objDoc = objWord.ActiveDocument
Else
 Set objDoc = objWord.Documents.Open("C:/Temp/test.docx", Visible:=True)
End If
...
</code></pre>

<p>However when running the code I get that the Document is open (Returned True from the IsFileOpen function from case 70) yet I get an error on 'objWord.ActiveDocument.Name' that no Document is Open</p>

<p><a href="https://i.stack.imgur.com/s5V0Y.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/s5V0Y.png" alt="enter image description here"></a></p>

<p>On Windows 7 Task Manager this is what I have. Word Application is closed but it appears there are background processes open of Word. However I close all documents I don't use so these processes shouldn't be running</p>

<p><a href="https://i.stack.imgur.com/kyvnA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kyvnA.png" alt="enter image description here"></a></p>