Export to Delimited Txt file using Macro

  • Thread starter Thread starter CB
  • Start date Start date
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.
 
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?
 
Back
Top