Message 1 of 4
CustomTable Error: COMException when trying to read cell value

Not applicable
07-21-2008
10:14 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Please take a look at the code.
It contains code to access the value of a CustomTable cell. However in some use cases a value is never set and therefore a COMException is thrown. The code handles it with an On Error Resume next but I was wondering if there is a better way to handle the error.
Thanks,
Nate
It contains code to access the value of a CustomTable cell. However in some use cases a value is never set and therefore a COMException is thrown. The code handles it with an On Error Resume next but I was wondering if there is a better way to handle the error.
Thanks,
Nate
Private Sub UpdateRevTable(ByVal RevTable As CustomTable)
Dim RowCount As Integer = RevTable.Rows.Count
Dim LastRow As Row = RevTable.Rows.Item(RowCount)
Dim newRowContents(0 To 7) As String
Dim newRow As Row
On Error Resume Next
Me.m_ecoNumber = LastRow.Item(3).Value
If Me.m_ecoNumber Is Nothing Then
Me.m_ecoNumber = ""
End If
Me.m_effectivity = LastRow.Item(4).Value
If Me.m_effectivity Is Nothing Then
Me.m_effectivity = ""
End If
Me.m_ER = LastRow.Item(2).Value
If Me.m_ER Is Nothing Then
Me.m_ER = ""
End If
'Update Revision Table
newRowContents(0) = "-" 'Rev
newRowContents(1) = Me.m_ER 'ER
newRowContents(2) = Me.m_ecoNumber 'ECO
newRowContents(3) = Me.m_effectivity 'Effectivitiy
newRowContents(4) = "INITIAL RELEASE" 'Description
newRowContents(5) = Me.userName 'DRW
newRowContents(6) = "" 'CHK
newRowContents(7) = "" 'DATE
newRow = RevTable.Rows.Add(RowCount, False, newRowContents)
End Sub