Results 1 to 7 of 7
  1. #1
    Join Date
    Jul 2003
    Posts
    123

    Unanswered: Can't overwrite excelfile

    Hi there,

    I've got two macros that exports a table as an excel spreadsheet.
    The old spreadsheet is overwritten.

    The first one works ok but when the second one is run it displays the errormessage: "Cannot update. Database or object is read-only"

    No one else is using the database, the old spreadsheet is not read-only.

    When I look at the macros the look identical, the only difference is that they export two different tables.

    I use "TransferSpreadsheet" to do the export.

    Any suggestions?

  2. #2
    Join Date
    Aug 2003
    Location
    Belgrade
    Posts
    68

    Re: Can't overwrite excelfile

    Looks like your target spreadsheet is being used by someone else when you try to fill it with data from Access. Try to open the file in Excel. Check using the Task Manager wetter there is any invisible instance of Excel that is holding the file opened.

  3. #3
    Join Date
    Aug 2003
    Location
    Belgrade
    Posts
    68

    Re: Can't overwrite excelfile

    Looks like your target spreadsheet is being used by someone else when you try to fill it with data from Access. Try to open the file in Excel. Check using the Task Manager wetter there is any invisible instance of Excel that is holding the file opened.

  4. #4
    Join Date
    Jul 2003
    Posts
    123
    Nope. Unless Access itself has some kind of lock on it from an earlier query its unused.

    If i export the table manually it works... But the whole idea with macros is to get automation... :-)

  5. #5
    Join Date
    Aug 2003
    Location
    Belgrade
    Posts
    68
    Is "TransferSpreadsheet" the only action the macro does? (Sorry for duplicating my previous message, browser problems.)

  6. #6
    Join Date
    Jul 2003
    Posts
    123
    SetWarnings No
    TransferSpreadsheet
    SetWarnings Yes
    MsgBox

    It feels like its something outside the macro that affects this... but as I wrote earlier, there are no other users using this database.

  7. #7
    Join Date
    Aug 2003
    Location
    Belgrade
    Posts
    68
    The database is OK, but what about the target spreadsheet? If it is located on a network share, can you check the status of the file on the server?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •