I am trying to read a value from a specifi cell and all I am getting is a 'nothing' for the value.
I can see the worksheet name on the cells with the correct index, but I do not have a value for the cell.
What am I doing wrong?
I am using VB .Net 2005 with NetAdvantage 7.2
My code is as follows
Dim oWorkSheet As Worksheet
Dim iLoop As Int64
Dim strRefNumber As String
Dim strCollectionStatus As String
Dim dAmountCollected As Double
Dim dtCollectionDate As Date
Dim iCustomerId As Int64
Try
oWorkbook = Workbook.Load(strFilename)
iMaxRecord = 0
Do While Not oWorkSheet.Rows(iMaxRecord).Cells(8).Value Like "Totals*"
iMaxRecord += 1
Loop
If IsNumeric(oWorkSheet.Rows(iLoop).Cells(1).Value) Then
strRefNumber = oWorkSheet.Rows(iLoop).Cells(2).Value
strCollectionStatus = oWorkSheet.Rows(iLoop).Cells(6).Value
dAmountCollected = oWorkSheet.Rows(iLoop).Cells(11).Value
dtCollectionDate = oWorkSheet.Rows(iLoop).Cells(8).Value
iCentreId = Mid(strRefNumber, 1, 2)
If InStr(strRefNumber, "/") = 0 Then
iCustomerId = Mid(strRefNumber, 3, Len(strRefNumber) - 2)
iContractid = 0
Else
iContractid = Mid(strRefNumber, InStr(strRefNumber, "/") + 1)
End If
UpdateCollectionStatus(iCentreId, iCustomerId, iContractid, strCollectionStatus, dtCollectionDate, dAmountCollected)
Next
MessageBox.Show(ex.Message)
Finally
oWorkSheet = Nothing
oWorkbook = Nothing
End Try