I have a request for some contract work from an organization that uses Excel as a database and wants to do some work on the Excel data via a real database. (Yeah, I know, never mind...)
The client has an Excel sheet that they use internally to keep track of some government programmes. The data from this Excel sheet used to be manually imported into a SQL database via CSV as intermediate format and made available via a tiny web app. Changes in either the spreadsheet or the db were done manually (by different people) and had to be kept in sync manually.
The spec for new functionality includes:
- upload the Excel file into the web app
- make minor changes via the web app (this bit is, of course, a no-brainer)
- occasionally export the data back into Excel
The spreadsheet (actually, it's a couple of them in a workbook) implements some guidelines necessary to interact with other institutions and therefore has to remain the same structurally before and after import. It contains a lot of formatting, hidden columns and sort buttons as well as a lot of data links between the cells in the different sheets.
I don't want to have to reproduce the spreadsheet from scratch to deliver the export, nor do I want to manually extract the proper columns into CSV before making the import. I'm rather looking for a way to load the Excel, "query" certain fields, write them to the DB and later load the data back from the DB and manipulate only the contents of the proper cells.
Is there a way to programatically interface with an existing spreadsheet and only read or change the bits that you need?