Hi.
I'm trying to put data from my Access dB to an Excel Workbook.
When I first try to really put the data in the cell, I get an error messege
telling me that this excel file is protected, therefore i cannot edit it.
I've checked it out (Tools-Protection), and it is not protected.

This is the code:

================================================== ======
EmptyPath = DLookup("xlspath", "aguda") & "EmptyReport2.xls"
Const MatchShift = 7
Const PlayerShift = 11
Dim xlApp As Excel.Application
Dim xlBook As Excel.Workbook
Dim new_xlBook As Excel.Workbook
Dim xlSheet As Excel.Worksheet
Dim xlSheet2 As Excel.Worksheet
Dim rstMatch As Recordset
Dim rstScores As Recordset, rstPlayers As Recordset, rstTeams As Recordset
Dim index As Integer, i As Integer
Dim MatchesCollection As New Collection
Dim PlayersCollection As New Collection
Dim db As Database

Set db = CurrentDb
' Assign object references to the variables. Use
' Add methods to create new workbook and worksheet
' objects.
Set xlApp = New Excel.Application
Set xlBook = xlApp.Workbooks.Open(EmptyPath)
Set xlSheet = xlBook.Worksheets(1)
Set xlSheet2 = xlBook.Worksheets(2)
Set rstMatch = db.OpenRecordset("SELECT * FROM tblExcelReport_MatchBoard ORDER BY tblExcelReport_MatchBoard.MatchDate, tblExcelReport_MatchBoard.MatchId;")
Set rstScores = db.OpenRecordset("SELECT * FROM tblExeclReport_PlayerScores order by PlayerName")
Set rstTeam = db.OpenRecordset("Select distinct TeamNumber,TeamName from TblTeam order By TeamNumber")
For i = 2 To 2 + rstMatch.RecordCount - 1
' xlSheet.Cells(3, i).Value = i - 1
xlSheet.Cells(4, i).Value = rstMatch!MatchName
xlSheet.Cells(5, i).Value = rstMatch!MatchDate
xlSheet.Cells(6, i).Value = rstMatch!PlaceTeur
' xlSheet.Cells(7, i).Value = rstMatch!PlacePhone
' xlSheet.Cells(8, i).Value = rstMatch!PlaceAddress

' xlSheet2.Cells(4, i + MatchShift - 1).Value = i - 1
' xlSheet2.Cells(5, i + MatchShift - 1).Value = rstMatch!MatchName
' xlSheet2.Cells(6, i + MatchShift - 1).Value = rstMatch!MatchDate

'Adding TEamId as a key to a collection of teams
' ADD Item,(string)Key
MatchesCollection.add i - 1, CStr(rstMatch!MatchId)

rstMatch.MoveNext
Next
================================================== ========

Everything works well until the red-colored line where i get the Error messege.

Thank you in advance, Jesse.