from a datagrid on an asp.net web page. I want users to be able to export a datagrid to an excel file, make whatever changes they need to the excel file and then import the changed excel file back into the datagrid. I have implemented this, and it works but:
1. When the user exports the datagrid to an excel file, the File Download pop up gives the choice of Open, Save or Cancel. They must first open the file and then select "File - Save As - MS Office Excel Workbook" for the excel file to be in the correct format. If they just choose Save instead of Open, the error "External table is not in the expected format..." is given when they try to import the file back in. Is there any way around this, changing some attribute or file extenstion?
2. I want to be sure that the user is in fact using the file they originally downloaded and not an excel file that they created. Is there a way of inserting hidden data like a header or something that I could check before I allow them to upload the file?
I don't have a problem exporting the datagrid as an excel file. The problem is that if the file is downloaded without Open - Save As, I have problems uploading the file back into the system. I get the error "External table is not in the expected format...". If the file is opened and Save As type Microsoft Excel Worksheet then I can upload the file w/o problems. Note that the file is saved as a MS Excel Worksheet in either case. I recall reading somewhere that there is no way around this but I need to be sure.