Export to Delimited Txt file using Macro

C

CB

I am using Access 2003. I can manually export one of my tables, but I am
having a terrible time trying to automate it. I have tried two different
approaches, both of which failed miserably.
1. I did a TransferText with an export type of "Export Delimited". I had
previously created a spec and chose that spec from the drop down. I entered
the table name of CITY and specified a file name including the path. I set
field names to "Yes". When I run the macro, I get the following message:
"Cannot update. Database or object is read-only." I didn't open it as read
only. The database is not in a read only folder. I can make changes to the
table. I am the administrator of the database. I can manually export it.
The name of the table is correct.

Please help.
2. In my second attempt, I do a SelectObject to choose my table and then
RunCommand of Export. I then try to do a series of SendKeys to mimic the
process of manually exporting the table. It works up until the SendKeys. It
doesn't appear to be applying the SendKeys to the export wizard window.

Please help.
 
J

Jerry Whittle

Check if the table, or a query, form, or report based on it, is open at the
time that you are trying the export. Close them and try again.

Check the folder where you are trying to export the file. Do you have
permissions to read, write, create, or delete there? Also is there a copy of
the file with the same name already there?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top