Hi All
I have a code and iam getting error any one please solve i have highlighted the area where the code stucked
Private Sub btn1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles btn1.Click
Dim xlApp As Excel.Application
Dim xlSht As Excel.Worksheet
Dim xlRng As Excel.Range
xlApp = New Excel.Application
xlApp.DisplayAlerts = False
xlApp.Workbooks.Open ("c:\test.xls")
xlSht = xlApp.Sheets(1)
xlRng = xlSht.Cells(1, 1)
Catchex As Exception
Textbox1.Text& = ex.ToStringxlApp.Workbooks.Close()
ReleaseComObject (xlApp)
xlSht = Nothing
xlApp = Nothing
GC. Collect()
End
Try
End Sub
Bookmarks