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.
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.
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
@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,??????
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.
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)
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.
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.