C#: How to access an Excel cell?

后端 未结 7 1120
忘掉有多难
忘掉有多难 2020-12-05 18:25

I am trying to open an Excel file and populate its cells with data? I have done the following coding so far.

Currently I am at this stage with the following code but

7条回答
  •  Happy的楠姐
    2020-12-05 19:03

    Simple.

    To open a workbook. Use xlapp.workbooks.Open()

    where you have previously declared and instanitated xlapp as so.. Excel.Application xlapp = new Excel.Applicaton();

    parameters are correct.

    Next make sure you use the property Value2 when assigning a value to the cell using either the cells property or the range object.

提交回复
热议问题