Using Microsoft Access VBA, I am trying to open up an excel workbook in Non-Read mode but it keeps opening up in read-only mode.
This is my code:
Code:Sub ExportToExistingFile(file As String, queryName As String) Dim xlApp As Object Set xlApp = CreateObject("Excel.Application") xlApp.Visible = True Dim xlWbk As Object Set xlWbk = xlApp.workbooks.Open(file, False, False) Dim rs As DAO.Recordset Set rs = CurrentDb.OpenRecordset(queryName) xlWbk.Worksheets.Add(After:=xlWbk.Worksheets(xlWbk.Worksheets.Count)).Name = "sdada" xlWbk.Worksheets(2).Range("A1").copyfromrecordset rs xlWbk.Close True xlApp.Quit End Sub