Save embedded object?

C

Charlotte E.

I have a spreadsheet with an embedded MIDI sound file as an object in the
spreadsheet...

How to I save/export this object, in VBA code, as a file on my harddrive???

I can do it manually, but when I try to 'record' the procedure, the
macro-recorder doesn't record the saving of the file...

Can this be done in VBA???


TIA,

CE
 
P

Peter T

AFAIK would need to extract the MIDI file from the xls file. IOW, read the
xls into a byte array, search for the MIDI file header, hope the file length
is in its next few bytes (+ header length), read the "section" as pertains
to the MIDI file into another byte array, then write that to file.

Only trouble is I can't find the anticipated MIDI file header when embedded
in an xls file (looking in a HEX editor). I'm looking for "MThd", or the
first 4 bytes in HEX of '4D 54 68 64'

Just had another look at a MIDI file in a HEX editor, although the header
"MThd" always exists not sure its file length is specified in the next few
bytes, which is odd.

That's as far as I've got, not the answer but perhaps a few clues for anyone
else interested to have a go.

Regards,
Peter T
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top