VB.net Excel.worksheet().cells().Value

后端 未结 2 1406
南笙
南笙 2021-01-20 07:38

Trying to write information in Excel worksheet But have some strange problems ;) i looked info on Google but no result.. So plz help )

I Add reference Microsoft.exce

2条回答
  •  攒了一身酷
    2021-01-20 08:03

    That's because .Cells() returns an object.

    You can try converting it to a Excel Cell object in another step, or you can try this (for example):

    shXL.Range("A2").Value
    

    With conversion will be:

    Dim xRng As Excel.Range = CType(shXL.Cells(3,3), Excel.Range)
    Dim val As Object = xRng.Value()
    

提交回复
热议问题