When I click text1, readwritetest.xls then open readwritetest.xls (read only) cell A1 has not changed. After exiting VB readwritetest.xls remains as read only.
VB Code:
Private Sub cmdOpenWorkSheet_Click() Dim xls As Excel.Application Dim xlBook As Excel.Workbook Set xls = New Excel.Application Set xlBook = xls.Workbooks.Open(App.Path & "\readwritetest.xls") xlBook.Sheets("sheets").Cells(1, 1) = Me.Text1 End Sub Private Sub Text1_Click() Call cmdOpenWorkSheet_Click End Sub




Reply With Quote