Dim xlPackage As ExcelPackage = New ExcelPackage(New IO.FileInfo("C:\Users\jtang20\Desktop\test.xlsx")) Dim sheet As ExcelWorksheet = xlPackage.Workbook.Worksheets("Sheet1")
If sheet.cells("H9").value Is Nothing Then
console.WriteLine("False 1")
Else
console.WriteLine("True")
End If
xlPackage.Dispose()
开始是想写 If sheet.cells("H9").value.tostring = "" , 但是会报错,所以要写 If sheet.cells("H9").value Is Nothing