View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Andy Kessel Andy Kessel is offline
external usenet poster
 
Posts: 5
Default Cleaning some blob data

I would agree, it would be better to have in a dll. Just currently
beyond my tools set.
Problem is that I have to do this with a bunch of files, so it would be
particularly useful to have a faster routine. I wish our database
software, didn't add the extra info to the front of the jpeg, then I
wouldn't have this problem.

If interested in writing such a thing, let me know - I could give you
more to work with, and let you price it for me. If interested email me
at .

Thanks, Andy


Open the file in binary mode and read a group of 4 bytes, instead of
character by character. U can store 4 bytes in a byte array, rather than a
string.

Public Sub ReadJPGHeader()
Dim FileNum As Integer
Dim FileName As String
Dim FileHeader(3) As Byte
FileNum = FreeFile
FileName = "C:\TEST.JPG"
Open FileName For Binary Access Read As FileNum
Get FileNum, , FileHeader
Close FileNum
'MsgBox Hex(FileHeader(0))
'MsgBox Hex(FileHeader(1))
'etc.
End Sub


But after all it's way faster to do this in C++, so a .dll that does the
dirty work, called by VBA.