harolda1980
Gebruiker
- Lid geworden
- 7 aug 2007
- Berichten
- 488
Ik wil een enkele cel lezen uit een excel bestand.
Alleen ik krijg de waarden er op geen mogelijkheid uit.
Kan iemand mij hier mee helpen?
Alleen ik krijg de waarden er op geen mogelijkheid uit.
Kan iemand mij hier mee helpen?
Code:
Private Sub Main()
Dim Proceed As Boolean = False
Dim xlApp As Excel.Application = Nothing
Dim xlWorkBooks As Excel.Workbooks = Nothing
Dim xlWorkBook As Excel.Workbook = Nothing
Dim xlWorkSheet As Excel.Worksheet = Nothing
Dim xlWorkSheets As Excel.Sheets = Nothing
Dim xlCells As Excel.Range = Nothing
Dim k As Long = 1
Dim i As Long = 1
xlApp = New Excel.Application
xlApp.DisplayAlerts = False
xlWorkBooks = xlApp.Workbooks
xlWorkBook = xlWorkBooks.Open(txtbestandslocatie.Text)
xlApp.Visible = True
' xlWorkSheets = xlWorkBook.Sheets(1)
Do
Import_landen(xlWorkBook.Sheets(1).Cells(k, i))
k = k + 1
Loop
xlWorkBook.Close()
xlApp.UserControl = True
xlApp.Quit()
ReleaseComObject(xlCells)
ReleaseComObject(xlWorkSheets)
ReleaseComObject(xlWorkSheet)
ReleaseComObject(xlWorkBook)
ReleaseComObject(xlWorkBooks)
ReleaseComObject(xlApp)
End Sub