Results 1 to 7 of 7
  1. #1
    erickfloyd's Avatar
    erickfloyd is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Nov 2017
    Posts
    18

    I can't export to excel spreadsheet twice after update access table.

    I can't export to excel spreadsheet twice after access table update because says "Cannot expand named range.", the only way that I can it's when I manually delete the excel tab that has been created before.

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    you MUST delete it first, otherwise it could contaminate the data.
    say export1 has 50 rows, then export2 is only 30 records, then the sheet still has 50. It does not clear the previous data.
    So you can always erase the file before export....

    kill sMyFile
    DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12, "qsMyQuery", sMyFile, True,tabname

  3. #3
    ssanfu is offline Master of Nothing
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    @erickfloyd,

    You really haven't provided enough info to even make a guess.

    What are you trying to do? Yes, export data , but describe from the 10,000 ft level.
    You want to export from Access to Excel; the same worksheet, different worksheets, different workbooks,????????


    How are you doing the export? Code, manually,??????

  4. #4
    erickfloyd's Avatar
    erickfloyd is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Nov 2017
    Posts
    18
    Hi Steve;

    Yes, I want to export from Access to Excel (Access Table), the same or different worksheet but same workbook, I'm doing this with an access macro action "TransferSpreadsheet"

    Thanks for your support.

  5. #5
    ssanfu is offline Master of Nothing
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    You have to remember that we can't see your dB nor understand your process except what you tell us. You might have been working on this for a couple of weeks, but we see only what you tell us. So far, you haven't explained much.


    I NEVER use macros, only VBA(code), so I won't be much help. I tried creating a "TransferSpreadsheet" macro.... and failed miserably.


    Maybe post your dB?? Then we can see what you are trying to do...... (Do a Compact & Repair, then Zip it)

  6. #6
    erickfloyd's Avatar
    erickfloyd is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Nov 2017
    Posts
    18
    My db It's linked by sql server to my system and I have some Access forms and queries that allow me make my job easier, Nevertheless on the last project, I make a table with more data than I can copy, that's what I asking if there are some VBA code or procedure to let me transfer data to excel spreadsheet the times that I need. I found the way to do'it with a macro action, but when I try to transfer data after one time I need delete the worksheet and save to transfer data on the same excell file again.


    So, I got an idea, there it's some VBA code to leave me transfer Access Table to excel spreadsheet and then another code to leave choose the excel file name and location, so in that way I could rename the excel spreadsheet when update the Access table before trasfer.





  7. #7
    ssanfu is offline Master of Nothing
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Would have to see the macro - and I would probably convert it to VBA.

    You browse Ken Snell's site to see some VBA for importing.

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

Similar Threads

  1. Replies: 2
    Last Post: 12-12-2014, 04:42 PM
  2. Replies: 1
    Last Post: 05-23-2013, 10:00 AM
  3. Replies: 5
    Last Post: 03-13-2013, 02:11 PM
  4. Replies: 1
    Last Post: 01-16-2012, 06:12 PM
  5. Replies: 1
    Last Post: 08-12-2010, 10:04 PM

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