Hey everyone, I know this has been done a million times before, but I cant't get the thing to work.. I need to write to a new line in excel every time, so I guess it needs to read the last line then add text on the new one?
I know this wont work, I don't know what to reference whenCode:Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click Dim excel_app As New Excel.Application() Dim oExcel As Object Dim oBook As Object Dim oSheet As Object excel_app.Visible = False oExcel = CreateObject("Excel.Application") oBook = oExcel.Workbooks.Open(My.Computer.FileSystem.SpecialDirectories.Desktop + "\Repairs.xlsx") oSheet = oBook.worksheets(1) oSheet.Cells.SpecialCells(Excel.XlCellType.xlCellTypeLastCell).Row '''TESTING AREA''' If CheckBox1.Checked = True Then oSheet.Cells(2, 1) = "Road Legal" End If If CheckBox2.Checked = True Then oSheet.Cells(2, 1) = "Off-Road Only" End Iffinds the last rowCode:oSheet.Cells.SpecialCells(Excel.XlCellType.xlCellTypeLastCell).Row
Thanks




Reply With Quote
