I have a windows application form created in visual studio 2013. I need to enter data from form to excel sheet until the users close the form. The workbook will be shared by multiple users at the same time. Moreover, I do not want them to see the workbook unless they open it.
How do I do this?
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
xlWorkBook = xlApp.Workbooks.Open("C:\1.xlsx")
xlWorkSheet = xlWorkBook.Sheets("Sheet1")
Dim iRow As Long
Dim alpha As Long = 0
iRow = 5
Do While .Cells(iRow, 2).value <> ""
iRow = iRow + 1
.Cells(iRow, 2).Value = t1.Text
.Cells(iRow, 3).Value = t2.Text
.Cells(iRow, 5).Value = t3.Text
xlApp.DisplayAlerts = False
I solved this: