can't you compare if it has a G as the first letter then? (im not sure how this works i havent tried it)

Code:
    j = InStr(1, buf, GifEnd) + 1
    fileHeader = Left(buf, j)
    '.....
    If Left$(fileHeader, 1) <> "G" Then
       MsgBox "This file is not a *.gif file", vbCritical
       Exit Function
    End If
I know this will not make SURE it is a gif file