Did you ever need to import Excel spreadsheets? If you did, you know there're sometimes problems with interop assemblies deploying to desktops and so.
Office 2003 offers to store spreadsheets in XML. So store your spreadsheet as XML and try to import them. Just include ExcelReader.cs in your project and use
SPOTX namespace. Then you'll be able to add the imported
DataTable as datasource to your grid, like in the included example.
public partial class MainForm : Form
private void importXMLSpreadsheetToolStripMenuItem_Click(object sender,
if (ctlOfn.ShowDialog() == DialogResult.OK)
The first row in the imported Excel file are column headers. The method was tested on contiguous spreadsheets only.
The code is clear enough I think, so adapting for .NET 1.1 consists only in replacing the
Also modifying import to return collections or to omit column headers seems easy.
Hope this will help somebody.
Software Developer (Senior)
Currently senior developer at eLinkx, started with C\C++ in industry software companies. Mainly .NET GUI, OR and application server frameworks.
Hobbies - Astronomy (selfmade Dobson f/6 1200mm), HW (Atmel51, ARM), Sport (paragliding, footbal, tennis, skiing, skating ... definitely I like all sports).
My family is wide - with my wife we have 3 kids.