Table Manipulation – Get ListObject
Retrieves a Excel.ListObject (Excel table) by name from the specified Excel.Worksheet.
If the specified table name does not exist in the worksheet, the function catches the exception and returns Nothing.
VB
Public Function xlGetListObject(wsSheet As Excel.Worksheet,
TableName As String) As Excel.ListObject
If wsSheet Is Nothing Then Return Nothing
Try
Return wsSheet.ListObjects(TableName)
Catch ex As Exception
Return Nothing
End Try
End Function