MSDN Magazine October 2001
View Complete Post
I've successfully used the Excel COM objects in C# to extract the contents of the sheets. I then use this information in a datagridview.
Rather than just cycle through each cell for the values to build up what needs to be displayed however I used the Worksheet.UsedRange.get_value() method instead which returns a 2D array of objects containing the string values of the cells.
I've done this since going through each cell individually appears to slow things down considerably, especially when larger Excel files are being opened. I would like to also apply as much of the formatting as possible from the file too, however there
doesn't appear to be a clear way to extract formatting information in a similar way to get_value. I could go back to cycling through the cells, but this would probably incur an unacceptable loss in speed as a result.
Does anybody know how to retrieve formatting information using a way that's similar in terms of output to the way that get_value works?