BIFF formats are Microsoft's open specification. (Please note that I am saying that the specification is not standard). Let me read this to get an idea of what is going on.
Then those BIFFs that you see correspond to some Excel formats. BIFF5 is XLS from Excel 5.0 and 95, BIFF8 is XLS from Excel 97 in 2003, BIFF12 is XLS from Excel 2003, note that Excel 2007 can also create them (I think Excel 2010 too). There is some documentation here as well as here (from OpenOffice) that can help you understand the binary there ...
In any case, some work has been done in the past to analyze these documents in C ++, Java, VB and, for your taste, in C #. For example, the BIFF12 Reader , the NExcel project, and ExcelLibrary , to cite a few.
In particular, NExcel will allow you to transfer a stream that you can create from clipboard data, and then query NExcel to retrieve the data. If you are going to take the source code, I think ExcelLibrary is much more readable.
You can get the stream as follows:
var dataobject = System.Windows.Forms.Clipboard.GetDataObject(); var stream = (System.IO.Stream)dataobject.GetData(format);
And read that the stream with NExcel will be something like this:
var wb = getWorkbook(stream); var sheet = wb.Sheets[0]; var somedata = sheet.getCell(0, 0).Contents;
I think the actual Microsoft Office libraries will work as well.
I know that this is not the whole story, please share how this happens. Try it if I get a chance.
Theraot
source share