Export to Excel failure

The_Kurgan

Active Member
Joined
Jan 10, 2006
Messages
270
Greeting all!


I am using an Access (2010) macro to export a table to an Excel workbook via the ImportExportSpreadsheet function. I’ve used this many times in the past, but never had this issue. It appears that it appends the data to the old data and removes the old data. For example, if my old data ended on row 500, rows 2-500 would be deleted and the new data would start on row 501. Any ideas what I may be doing wrong?



I apologize if I should have posted this under Excel… was unsure which would be best.


Thanks in advance!
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Your statement has a conflict: macro to export a table to an Excel workbook via the ImportExportSpreadsheet

To export you must use TRANFERSPREADSHEET acExport
And yes, if you keep exporting to the same file, it will always overwrite what is in the tab. You must delete the existing file before you export to get a fresh copy of data.
 
Upvote 0
Thanks for the reply, but as I mentioned... I've used the ImportExportSpreadsheet many times to plug a table into Excel and have never had this difficulty. Yes, it definitely should overwrite the existing data, but it doesn't. It appends and then deletes the old.
 
Upvote 0
it overwrites the existing data. If you have cells or records that extend beyond that, it wont overwrite. Thats why you must kill the file
or use fso.delete BEFORE you export to have a clean slate.
 
Upvote 0

Forum statistics

Threads
1,213,531
Messages
6,114,167
Members
448,554
Latest member
Gleisner2

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top