Take the 2-minute tour ×

I'm building a spreadsheet that tracks software installations that requires a special configuration file. I'd like to store the file inside the spreadsheet, so the spreadsheet is a "one-stop-shop" for everything related to these installations. Basically like a (extremely simple) database.

How can I store a file inside a cell?

share|improve this question
a file normally contains 1000000 of whatever. why do you need the content of a file inside one single cell? –  akira Aug 4 '10 at 16:06
@akira - Added more info on what I'm trying to do. –  J. Polfer Aug 4 '10 at 17:07

6 Answers 6

up vote 2 down vote accepted

It is possible to insert files into Excel spreadsheets. This tutorial gives instructions on how to do it for a .pdf file, but a text file should work just as well.

Note that the file can be inserted as an icon, but it will not actually reside inside a cell. The best you can do is place it on top of the cell you want, and then Excel will automatically move it around if you add rows or columns to the worksheet.

share|improve this answer

I don't think you can store a FILE but you can store a reference to a file. I.e. -

  • Hyperlink to the directory or network locaton
  • Hyperlink to the website or ftp location of the file


share|improve this answer
For the interim, I'm doing this. But ideally, I'd love to put everything in one giant file so there's no confusion on where to find things. –  J. Polfer Aug 4 '10 at 17:09
OK I just read your edit to the OP. If the config file is text based, you can store it as a sheet inside the workbook, then reference it in your cell. –  JNK Aug 4 '10 at 17:13
Okay. What options do I have if the file is a binary? –  J. Polfer Aug 4 '10 at 18:05
@sheepsimulator: encode it as text (base64) –  akira Aug 5 '10 at 5:38

I think this is a 'do you really want to do this (*)' kind of thing. Excel has it's own formatting rules. If the file is small enough to 'fit' in excel, it's probably a config file, which tend to be really really format sensitive. I don't think excel has the concept of a BLOB, just a stream of bytes that aren't interpreted.

Also, you'll probably have to deal with locking and copying problems.

I suggest sqlite. sqlite3 can do BLOBs. And there are so many interfaces to it, including most programming languages, and small guis. Excel/OpenOfficeCalc could access sqlite3 with the right DB drivers. Your DB, like the excel file, would just be a file on disk someplace, you don't need to set up a db server.

(*) yes i hate 'do you really want to do this' posts too.

share|improve this answer
I agree with you on this (I use sqlite for other projects). The objective, at some point, is to do precisely what you describe in your third paragraph. But in the interim, we need something quick & dirty. –  J. Polfer Aug 4 '10 at 19:45
What would be really cool is if I could whip up some real basic forms (it doesn't have to look nice) on top of the sqlite database that would take me less than a couple of hours. I know Oracle used to have this thing called Forms that you could use to do something similar to this. –  J. Polfer Aug 4 '10 at 19:49
@sheepsimulator I haven't done this, but it may be worth using OpenOffice with a SQLite JDBC driver and using the db/calc portions to play with your data. –  Rich Homolka Aug 4 '10 at 21:31

If it's only a small file, could you look at encoding the file as base64 or something similar (code available here) and store the result in a cell.

You could then decode it back for use and recode it to save.

I'm not sure when you'd start hitting cell length limits, but it's a start.

share|improve this answer

Insert > Object > Create from File > Browse

It does not exactly attach a file in a CELL, but in the WORKSHEET (represented by an icon).
You can also change the icon image or rename the icon.

Reference link (with screenshots):

share|improve this answer

Please read completely C++ source code in this Article (2 functions in bootom of listings: **InsertFileToWorksheet,CopyFileFromWorkSheet)

share|improve this answer
Also, I'm quite sure the question asker didn't expect to be doing this using C++... –  Arjan Apr 14 '13 at 12:29

Your Answer


