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?

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

6 Answers 6


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.


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

Can you give some more info on what you are trying to do?

  • 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, 2010 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, 2010 at 17:13
  • Okay. What options do I have if the file is a binary?
    – J. Polfer
    Aug 4, 2010 at 18:05
  • @sheepsimulator: encode it as text (base64)
    – akira
    Aug 5, 2010 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.

  • 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, 2010 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, 2010 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. Aug 4, 2010 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.


A .pdf cannot be inserted as a comment to a cell, but you can absolutely do it by converting the file to .jpg. If this is something that you would like to know, then follow the steps.

  1. Convert .pdf to .jpg.
  2. Select a cell, right click and insert a comment. (You can leave it blank.)
  3. Go to "Review" tab on the menus and under the "comments" section click on "show all comments".
  4. Hover back to the edge of the inserted comment on the cell and right click. Choose "Format comment".
  5. A pop-up screen will appear. Just choose the "Color and Lines" tab.
  6. Go to the "Color" field and at the drop-down list box, choose "Fill Effects".
  7. Another screen will pop-up. Just choose the "Picture" tab. Select picture. Save or OK.
  8. Back at the sheet, go to the "Review" menu again and click "show all comments" again to go back to the normal view.
  9. Done.

enter image description here

The .jpg will only show whenever you hover to the exact cell you have inserted the file as the normal comment does.


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):

Not the answer you're looking for? Browse other questions tagged or ask your own question.