You need to download and install OWC 11 (Office Web Components), reference the dll's, and learn about the classes and functions in that library, which allows you to do anything you can do in Excel with your code, such as read in data from the cells of a worksheet.
I am not a fan of these types of assignments and I am of the opinion that the right thing to do would be to create a web form that the user uses to enter the data. How is it any different for the user to enter data in excel as opposed to entering it in a web form? The big difference is now you have to learn how to use this whole new huge library of classes and functions and the data entry process itself will not be improved one bit. In fact unless those excel spreadsheets they are uploading are locked down, they will always have too much ability to rearrange the spreadsheet and create hell and havoc for you.
The other reason I always gag at the excel upload to database requirement is that it doesn't make any sense from a software system perspective. You go through all the trouble the make a web application (and it is more trouble than a windows app) so that you get cross platform compatibility through the mostly universal web browser, and then you create a dependency on a Windows Application, Microsoft Excel, which not everyone has and tie yourself down to one product that isn't cross platform compatible. It doesn't make a lot of sense.
Neil Timmerman
Programmer
Veris Consulting
|