hello experts, I want to read and write to an excel file and it seems to work except the workbook doesnt close and my changes arent always being saved can someone look at my code and see what I am doing wrong?
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim oExcel As Excel.Application
Dim oWorkBook As Excel.Workbook
Dim oWorkSheet As Excel.Worksheet
Dim j As Integer
j = 1
oExcel = New Excel.Application
oWorkBook = oExcel.Workbooks.Open("C:\smallcount\smallframe.xls")
oWorkSheet = oWorkBook.Worksheets().Item(1)
Dim o As Excel.Range = oWorkSheet.Cells.Item(j, 1)
Dim s As String = o.Cells.Text
Do While s <> ""
j += 1
o = o.Cells.Item(j, 1)
s = o.Cells.Text
o.Cells(j, 1).Value = "Testvalue"
oWorkBook.Application.DisplayAlerts = False