Results 1 to 1 of 1

Code Problem(open excel file update links)

Threaded View

farrukh Code Problem(open excel file... 04-09-2011, 02:16 PM
  1. #1
    Forum Contributor
    Join Date
    01-29-2011
    Location
    Pakistan
    MS-Off Ver
    Excel 2013
    Posts
    256

    Unhappy Code Problem(open excel file update links)

    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
    Last edited by farrukh; 04-09-2011 at 03:31 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1