Dim LastRow As Long
Dim objExcelWbk As Microsoft.Office.Interop.Excel.Workbook
Dim objExcelsht As Microsoft.Office.Interop.Excel.Worksheet
Dim objExcelApp As Application = System.Runtime.InteropServices.Marshal.GetActiveObject("Excel.Application")
With objExcelsht
While objExcelsht.Cells(rw, 2).value IsNot Nothing
Dim test As String = objExcelsht.Cells(rw, 2).value.ToString
rw = rw + 1
End While
LastRow = rw - 1
End With
Dim tgtcolm As Integer
Dim tgtcell As String
Dim LstBaseColm As Integer
'---------------------------------- searching tgtcolm -------------------------------
tgtcell = objExcelsht.Cells(1, 1).Value
While tgtcell <> ""
tgtcolm = tgtcolm + 1
tgtcell = objExcelsht.Cells(1, tgtcolm).Value
End While
LstBaseColm = tgtcolm
'tgtcolm = tgtcolm + 1
Dim LastRwColm As String
LastRwColm = objExcelsht.Cells(dumparrlCnt, tgtcolm + 1).Address(RowAbsolute:=False, ColumnAbsolute:=False)