Hi all
I'm new to Access and I'm trying to export two tables to a .xlsm macro enabled workbook.
Here's the code:
Code:
Function Macro2()
On Error GoTo Macro2_Err
DoCmd.TransferSpreadsheet acExport, 10, "Ass+Traf", CurrentProject.Path & "\queries.xlsm", True, "Sheet2"
DoCmd.TransferSpreadsheet acExport, 10, "ParqueSet2010 p/ Gessica", CurrentProject.Path & "\queries.xlsm", True, "Sheet3"
Macro2_Exit:
Exit Function
Macro2_Err:
MsgBox Error$
Resume Macro2_Exit
End Function
When I replace xlsm for xlsx it works fine, but in the above case I get the following error:
"Cannot update. Database is read-only".
I checked the file properties, and the read-only box is unchecked.
Does anyone know why this happens?
I need to export to a xlsm because I want to build excel macros in the destination file ("queries").
Thanks in advance