Issue with writing byte array to a file
I had the same problem - some 12 byte header thrown at the top of every file written. It turns out that the PUT command doesn't quite know how to handle data of type Variant. I'm not sure of the exact cause, but my work around was to simply replace the PUT line:
Put #iFileNum, lWritePos, vData
with this:
Dim buffer() As Byte
buffer = vData
Put #iFileNum, lWritePos, buffer
Problem solved.