You can add a parameter to the GetFileBytes
function so that you can let it skip a number of bytes at the beginning. Use the Seek
function to skip to a specific place in the file:
Private Function GetFileBytes(ByVal path As String, ByVal skip as Integer) As Byte()
Dim lngFileNum As Long
Dim bytRtnVal() As Byte
lngFileNum = FreeFile
If LenB(Dir(path)) Then ''// Does file exist?
Open path For Binary Access Read As lngFileNum
Seek lngFileNum, skip + 1
ReDim bytRtnVal(LOF(lngFileNum) - skip - 1&) As Byte
Get lngFileNum, , bytRtnVal
Close lngFileNum
Else
Err.Raise 53
End If
GetFileBytes = bytRtnVal
Erase bytRtnVal
End Function
Now you can specify that the first eight bytes should be skipped when you read the file:
bytes = GetFileBytes(sFileName, 8)