Open an Excel 2003 spreadsheet with C#. Could not find installable ISAM. Exception

后端 未结 4 1394
臣服心动
臣服心动 2020-12-20 16:27

I need to pull data from an xls, I also need have the user be able to change the location of the file it will. So an OleDbConnection seemed like a good start, and it was unt

4条回答
  •  醉梦人生
    2020-12-20 17:08

    Assuming your system requirements include an installation of Excel, you can use the Excel Object Library

    Excel.Sheets sheets = m_Excel.Worksheets;
    Excel.Worksheet worksheet = (Excel.Worksheet)sheets.get_Item(1);
    Excel.Range range = worksheet.get_Range("A1", "E1".ToString());
    

    etc.

    See also VSTO

提交回复
热议问题