I am getting "Error 3017 Cannot update. Database or object is read only" when trying to export a table to Excel. I use the same method that I use in other places which always works as expected.
The only difference in my current Sub is that I am opening a record set to get a name for the file. This routine is in a loop because I will be creating multiple Excel files, each with a different name. This is what that looks like:
Dim sCompany As String
Dim sMyPath As String
Dim sReportName As String
sCompany = rsCompany(0)
sMyPath = "T:\MyFolder\"
sFileName = sCompany & "Filename"
FileName:= sMyPath & sFileName, _
If I hard code FileName:= then it works without getting Error 3027. but written as above (sMyPath & sFileName) or any variation of that and it fails.
What am I doing wrong?