vsto 获取 sheet.Range[“C3:D100“]结束行

In VSTO (Visual Studio Tools for Office), you can use the following code snippet to get the end row of the range "C3:D100" in Excel:

```csharp
Excel.Range range = worksheet.Range["C3:D100"];
int endRow = range.Rows.Count + range.Row - 1;
```

This code assumes you have a reference to the Excel `Worksheet` object named `worksheet`. The `Rows.Count` property gives the number of rows in the range, and the `Row` property gives the starting row number of the range. By adding these values and subtracting 1, you can determine the end row of the range. The result will be stored in the `endRow` variable.

结束行位置是100

你可能感兴趣的:(vsto,vsto)