Results 1 to 3 of 3
  1. #1
    dlemos is offline Novice
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Oct 2010
    Posts
    2

    Transferspreadsheet: cannot export to .xlsm

    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

  2. #2
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    Quote Originally Posted by dlemos View Post
    "Cannot update. Database is read-only".

    I checked the file properties, and the read-only box is unchecked.

    Does anyone know why this happens?
    do you have the file open? xlsm's may not be valid file types for Access. If they're not, the workaround is to change your books to 97-2003 compatible. In those versions, there are no extra extensions for macro-enabled books.

    Quote Originally Posted by dlemos View Post
    ParqueSet2010 p/ Gessica
    as a side note, you really should never include slashes in an object name. spaces are not the best either...

  3. #3
    dlemos is offline Novice
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Oct 2010
    Posts
    2
    I still have the xlsm problem but I can use the 97-2003 extension, it works just fine.thanks for the help

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 12
    Last Post: 09-13-2012, 12:07 PM
  2. Transferspreadsheet Help Please
    By graviz in forum Programming
    Replies: 0
    Last Post: 11-30-2009, 02:56 PM
  3. Can't get TransferSpreadsheet to work
    By Valeda in forum Import/Export Data
    Replies: 0
    Last Post: 07-19-2007, 08:04 AM
  4. transferSpreadsheet
    By rabbit in forum Import/Export Data
    Replies: 1
    Last Post: 06-09-2006, 04:01 PM
  5. transferspreadsheet function
    By jeffj in forum Import/Export Data
    Replies: 3
    Last Post: 03-13-2006, 11:59 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums