Yes, you can store string and XML in Excel cells. For binary, you'd better not save it in Excel, but if you needed OLE (object binding and nesting) then be an option. You can do this by saving the binary as a file outside of Excel and then pasting it as an OLE object:
Dim mySht As Worksheet Dim oleFileName as String oleFile = "MyXmlDoc.xml" Set mySht = ActiveWorkbook.ActiveSheet mySht.Shapes.AddOLEObject Filename:=Environ$("Appdata") & _ "\MyFolder\" & oleFile, _ Link:=False, DisplayAsIcon:=True
This worked for us for certain types of generic file type. But we never did this for raw binary data. Usually we put a Word or PDF document in a spreadsheet. You also risk corrupting the book or losing binary data. In our case, the OLE object will be clicked by a user who had Wordperfect instead of Word, or they were running Linux / Mac, and the embedded document did not open.
This makes the Excel file pretty large with every added object added. This is an old technology with its quirks.
source share